> 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
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?
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to email@example.com
Please read the FAQ at http://www.tux.org/lkml/