Re: missing madvise functionality

From: Hugh Dickins
Date: Wed Apr 04 2007 - 10:37:40 EST


On Wed, 4 Apr 2007, Marko Macek wrote:
> Ulrich Drepper wrote:
> > A solution for this problem is a madvise() operation with the following
> > property:
> >
> > - the content of the address range can be discarded
> >
> > - if an access to a page in the range happens in the future it must
> > succeed. The old page content can be provided or a new, empty page
> > can be provided
>
> Doesn't this conflict with disabling overcommit?
>
> If the page is guaranteed to be available, obviously it must count as
> being commited, so this is not equivalent to real freeing.

No, there's no conflict with disabled overcommit here: Committed_AS
accounting is done on the whole vma size (at mmap or brk time), no
matter how many pages may or may not be faulted in later. Rather
like RLIMIT_AS. The proposed madvise operation won't affect it.

(But I take Ulrich's "must succeed" with one pinch of salt:
Out-Of-Memory killing remains a possibility, of course.)

Hugh
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/