[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: /dev/recycle
Jamie Lokier <lk@tantalophile.demon.co.uk> writes:
> Better than MADV_FREE: /dev/recycle
> --------------------------------------------------
>
> What about this whacky idea?
>
> MAP_RECYCLE|MAP_ANON initially allocates pages like MAP_ANON. Mapping
> /dev/recycle is similar (but subtly different).
>
> MADV_DONTNEED or munmap discard private modifications, but record this
> process as the page owner. If the process later accesses the page, a
> page is allocated again but the MAP_RECYCLE means it may return a page
> already marked as belonging to this process without clearing it.
>
> That's better for app allocators than MADV_FREE: they're giving the
> kernel more freedom with not much loss in performance. And the kernel
> likes this too -- no need for vmscan to release references, as the pages
> are free already.
This would only work for /dev/zero like mappings. I need it for shm
mappings.
Greetings
Christoph
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/