Messages in this thread | | | Date | Thu, 8 Oct 1998 14:06:38 +0100 | From | Jamie Lokier <> | Subject | Re: 'disposable' dirty pages [was: Out Of Memory in v. 2.1] |
| |
On Wed, Oct 07, 1998 at 12:03:48PM +0200, MOLNAR Ingo wrote: > if it's the libc malloc cache itself, then there need to be no action, > other than to remove that given area from the malloc cache. Due to the > asynchron behavior, more complex uses might be tricky.
This should be possible without a fault handler and minimal libc support.
When free() creates a large enough contiguous free region to be worth a syscall, call mmap(..., MAP_ANON | MAP_PRIVATE | MAP_DISCARDABLE, ...) to make an "optional zero-map" of the region.
This doesn't modify the VMA, but simply marks the pages as discardable until they're next touched or written. The kernel then has the option of unmapping the pages at any time until they're next written/touched (individually), and as it's a zero-map VMA, that effectively sets the discarded pages to all zeros according to kernel demands.
The process doesn't care whether any of those pages are discarded or not.
-- Jamie
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |