Well, actually I think this probably not necessary. Because the
Aubrey Li wrote:
> On 1/19/07, Vaidyanathan Srinivasan <svaidy@xxxxxxxxxxxxxxxxxx> wrote:
>>
>> Hi Aubrey,
>>
>> The idea of creating separate flag for pagecache in page_alloc is
>> interesting. The good part is that you flag watermark low and the
>> zone reclaimer will do the rest of the job.
>>
>> However when the zone reclaimer starts to reclaim pages, it will
>> remove all cold pages and not specifically pagecache pages. This
>> may affect performance of applications.
>>
>> One possible solution to this reclaim is to use scan control fields
>> and ask the shrink_page_list() and shrink_active_list() routines to
>> target only pagecache pages. Pagecache pages are not mapped and
>> they are easy to find on the LRU list.
>>
>> Please review my patch at http://lkml.org/lkml/2007/01/17/96
>>
>
> So you mean the existing reclaimer has the same issue, doesn't it?
Well, the existing reclaimer will do the right job if the kernel
really runs out of memory and need to recover pages for new
allocations. The pages to be removed will be the coldest page in
the system. However now with the introduction of pagecache limit,
we are artificially creating a memory scarcity and forcing the
reclaimer to throw away some pages while we actually have free
usable RAM. In this context the choice of pages picked by the
present reclaimer may not be the best ones.
If pagecache is overlimit, we expect old (cold) pagecache pages to
be thrown out and reused for new file data. We do not expect to
drop a few text or data pages to make room for new pagecache.