Re: [RPC][PATCH 2.6.20-rc5] limit total vfs page cache

From: Christoph Lameter
Date: Mon Jan 22 2007 - 14:23:58 EST


On Sat, 20 Jan 2007, Aubrey Li wrote:

> assume:
> min = 123pages
> pagecache_reserved = 200 pages
>
> if( alloc_flags & ALLOC_PAGECACHE)
> watermark = min + pagecache_reserved ( 323 pages)
> else
> watermark = min ( 123 pages)
>
> So if request pagecache, when free pages < 323 pages, reclaim is triggered.
> But at this time if request memory not pagecache, reclaim will be
> triggered when free pages < 123 as the present reclaimer does.
>
> I verified it on my side, why do you think it doesn't work properly?

The code does not check the page cache size but the number of free pages.
The page cache size is available via zone_page_state(zone, NR_FILE_PAGES).

In its current form your patch is making the system reclaim earlier for
page cache allocations. And its reclaiming regardless of the number of
pages in the page cache. If there are no pagecache pages but only
anonymous pages in the zone then the code will still reclaim although the
page cache size is zero.
-
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/