Re: 'disposable' dirty pages [was: Out Of Memory in v. 2.1]

Chris Wedgwood (chris@cybernet.co.nz)
Fri, 9 Oct 1998 18:11:44 +1300


On Thu, Oct 08, 1998 at 03:19:55PM +0100, Alan Cox wrote:

> The interface doesnt seem hard
>
> mprotect(buf,len, MDISCARDABLE)
>
> and then mprotect it back to something normal to use it. If the
> semantics are "COW's the zero page if discarded else gives the
> existing page back" then everything mallocish falls nicely into
> place.

I really like this idea... we simple mark memory we still might want
to use, but have otherwise decided we don't care what's in it.

That way, if the kernel is short on memory, it can burgle some of
these pages, and when an application decides it wants these again, we
just put a blank page back in its place...

This still doesn't solve the problem of all OOM situation though,
what if an application starts using these `disposable' pages (which
have been unmapped) and we don't have any free memory to replace the
unmapped pages with?

-cw

-
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/