To check on zone balancing, split the /proc/vmstat:pgsteal stats into pgsteal_hi and pgsteal_lo: highmem and lowmem. --- include/linux/page-flags.h | 5 +++-- mm/page_alloc.c | 5 +++-- mm/vmscan.c | 9 ++++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff -puN mm/page_alloc.c~instrument-highmem-page-reclaim mm/page_alloc.c --- 25/mm/page_alloc.c~instrument-highmem-page-reclaim 2004-02-22 02:08:12.000000000 -0800 +++ 25-akpm/mm/page_alloc.c 2004-02-22 02:08:12.000000000 -0800 @@ -1491,10 +1491,11 @@ static char *vmstat_text[] = { "pgscan", "pgrefill", - "pgsteal", + "pgsteal_hi", + "pgsteal_lo", "pginodesteal", - "kswapd_steal", + "kswapd_steal", "kswapd_inodesteal", "pageoutrun", "allocstall", diff -puN include/linux/page-flags.h~instrument-highmem-page-reclaim include/linux/page-flags.h --- 25/include/linux/page-flags.h~instrument-highmem-page-reclaim 2004-02-22 02:08:12.000000000 -0800 +++ 25-akpm/include/linux/page-flags.h 2004-02-22 02:08:12.000000000 -0800 @@ -108,10 +108,11 @@ struct page_state { unsigned long pgscan; /* pages scanned by page reclaim */ unsigned long pgrefill; /* inspected in refill_inactive_zone */ - unsigned long pgsteal; /* total pages reclaimed */ + unsigned long pgsteal_hi; /* total highmem pages reclaimed */ + unsigned long pgsteal_lo; /* total lowmem pages reclaimed */ unsigned long pginodesteal; /* pages reclaimed via inode freeing */ - unsigned long kswapd_steal; /* pages reclaimed by kswapd */ + unsigned long kswapd_steal; /* pages reclaimed by kswapd */ unsigned long kswapd_inodesteal;/* reclaimed via kswapd inode freeing */ unsigned long pageoutrun; /* kswapd's calls to page reclaim */ unsigned long allocstall; /* direct reclaim calls */ diff -puN mm/vmscan.c~instrument-highmem-page-reclaim mm/vmscan.c --- 25/mm/vmscan.c~instrument-highmem-page-reclaim 2004-02-22 02:08:12.000000000 -0800 +++ 25-akpm/mm/vmscan.c 2004-02-22 02:08:42.000000000 -0800 @@ -461,9 +461,6 @@ keep: list_splice(&ret_pages, page_list); if (pagevec_count(&freed_pvec)) __pagevec_release_nonlru(&freed_pvec); - mod_page_state(pgsteal, ret); - if (current_is_kswapd()) - mod_page_state(kswapd_steal, ret); mod_page_state(pgactivate, pgactivate); return ret; } @@ -537,6 +534,12 @@ shrink_cache(const int nr_pages, struct mod_page_state(pgscan, nr_scan); nr_freed = shrink_list(&page_list, gfp_mask, &max_scan, nr_mapped); + if (current_is_kswapd()) + mod_page_state(kswapd_steal, nr_freed); + if (is_highmem(zone)) + mod_page_state(pgsteal_hi, nr_freed); + else + mod_page_state(pgsteal_lo, nr_freed); ret += nr_freed; if (nr_freed <= 0 && list_empty(&page_list)) goto done; _