Index: linux-2.6.15-rc1-mm2/mm/rmap.c =================================================================== --- linux-2.6.15-rc1-mm2.orig/mm/rmap.c 2005-11-21 15:22:56.000000000 -0800 +++ linux-2.6.15-rc1-mm2/mm/rmap.c 2005-11-21 17:25:54.000000000 -0800 @@ -478,8 +478,10 @@ void page_add_file_rmap(struct page *pag BUG_ON(PageAnon(page)); BUG_ON(!pfn_valid(page_to_pfn(page))); - if (atomic_inc_and_test(&page->_mapcount)) + if (atomic_inc_and_test(&page->_mapcount)) { inc_page_state(nr_mapped); + atomic_dec(&page_zone(page)->nr_cache); + } } /** @@ -504,6 +506,7 @@ void page_remove_rmap(struct page *page) if (page_test_and_clear_dirty(page)) set_page_dirty(page); dec_page_state(nr_mapped); + atomic_inc(&page_zone(page)->nr_cache); } } Index: linux-2.6.15-rc1-mm2/include/linux/mmzone.h =================================================================== --- linux-2.6.15-rc1-mm2.orig/include/linux/mmzone.h 2005-11-21 14:29:46.000000000 -0800 +++ linux-2.6.15-rc1-mm2/include/linux/mmzone.h 2005-11-21 17:19:27.000000000 -0800 @@ -168,6 +168,8 @@ struct zone { /* A count of how many reclaimers are scanning this zone */ atomic_t reclaim_in_progress; + /* Size of the pagecache */ + atomic_t nr_cache; /* * prev_priority holds the scanning priority for this zone. It is * defined as the scanning priority at which we achieved our reclaim