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

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Fri, 9 Oct 1998 16:20:09 +0100


On Thu, Oct 08, 1998 at 07:35:50PM +0100, Alan Cox wrote:
> Its far more useful than a straight forward reclaim of zeroed pages
> because apps that know about it can use reclaimable memory for things
> like pixmap caches providing there is a suitable way to get info on
> what was discarded.

One way to get this info would be to allow support two kinds of discardable:

"zero-map on discard" would be ideal for malloc cache (it doesn't care
if individual pages are zeroed, and may be possible without an extra
VMA in the malloc case).

"unmap on discard" would raise a SEGV when a discarded page is accessed,
allowing the app. to recreate the object containing the discarded page.
This opens a few interesting possibilites:

- The kernel will tend to discard old (age) pages not new ones.
So if only part of a discardable object is used a lot, the
remainder can be reclaimed.

- This is perfect for user-level paging. E.g., the non-aligned
file mappings in Wine, calculated large objects e.g. font cache in X.
The kernel can apply the same aging policies as it does for
kernel-level paging.

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