Index: linux-2.6.15-rc2/include/linux/mmzone.h =================================================================== --- linux-2.6.15-rc2.orig/include/linux/mmzone.h 2005-11-23 01:38:17.000000000 +0000 +++ linux-2.6.15-rc2/include/linux/mmzone.h 2005-11-23 01:40:09.000000000 +0000 @@ -157,6 +157,7 @@ struct zone { unsigned long nr_scan_inactive; unsigned long nr_active; unsigned long nr_inactive; + unsigned long nr_unmapped; /* unmapped pages on LRU */ unsigned long pages_scanned; /* since last reclaim */ int all_unreclaimable; /* All pages pinned */ Index: linux-2.6.15-rc2/mm/vmscan.c =================================================================== --- linux-2.6.15-rc2.orig/mm/vmscan.c 2005-11-20 03:25:03.000000000 +0000 +++ linux-2.6.15-rc2/mm/vmscan.c 2005-11-23 01:53:20.000000000 +0000 @@ -61,6 +61,8 @@ struct scan_control { /* Incremented by the number of pages reclaimed */ unsigned long nr_reclaimed; + long nr_unmapped; /* update zone->nr_unmapped */ + unsigned long nr_mapped; /* From page_state */ /* How many pages shrink_cache() should reclaim */ @@ -440,10 +442,10 @@ static int shrink_list(struct list_head case SWAP_AGAIN: goto keep_locked; case SWAP_SUCCESS: - ; /* try to free the page below */ + sc->nr_unmapped++; + /* try to free the page below */ } } - if (PageDirty(page)) { if (referenced) goto keep_locked; @@ -537,6 +539,7 @@ static int shrink_list(struct list_head free_it: unlock_page(page); reclaimed++; + sc->nr_unmapped--; if (!pagevec_add(&freed_pvec, page)) __pagevec_release_nonlru(&freed_pvec); continue; @@ -635,6 +638,7 @@ static void shrink_cache(struct zone *zo &page_list, &nr_scan); zone->nr_inactive -= nr_taken; zone->pages_scanned += nr_scan; + sc->nr_unmapped = 0; spin_unlock_irq(&zone->lru_lock); if (nr_taken == 0) @@ -652,6 +656,7 @@ static void shrink_cache(struct zone *zo sc->nr_to_reclaim -= nr_freed; spin_lock_irq(&zone->lru_lock); + zone->nr_unmapped += sc->nr_unmapped; /* * Put back any unfreeable pages. */