lkml.org 
[lkml]   [1998]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: '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/

\
 
 \ /
  Last update: 2005-03-22 13:44    [W:0.099 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site