When page reclaim is working out how many pages to san in a zone (max-scan) it presently rounds that number up if it looks too small - for work batching. Problem is, this can result in excessive scanning against small zones which have few inactive pages. So remove it. Not that it is possible for max_scan to be zero. That's OK - it'll become non-zero as the priority increases. --- mm/vmscan.c | 5 +---- 1 files changed, 1 insertion(+), 4 deletions(-) diff -puN mm/vmscan.c~vmscan-balance-zone-scanning-rates mm/vmscan.c --- 25/mm/vmscan.c~vmscan-balance-zone-scanning-rates 2004-02-28 23:38:13.000000000 -0800 +++ 25-akpm/mm/vmscan.c 2004-02-28 23:38:13.000000000 -0800 @@ -809,8 +809,7 @@ shrink_caches(struct zone **zones, int p if (zone->all_unreclaimable && priority != DEF_PRIORITY) continue; /* Let kswapd poll it */ - max_scan = max(zone->nr_inactive >> priority, - SWAP_CLUSTER_MAX * 2UL); + max_scan = zone->nr_inactive >> priority; ret += shrink_zone(zone, max_scan, gfp_mask, total_scanned, ps); } return ret; @@ -934,8 +933,6 @@ static int balance_pgdat(pg_data_t *pgda } zone->temp_priority = priority; max_scan = zone->nr_inactive >> priority; - if (max_scan < SWAP_CLUSTER_MAX) - max_scan = SWAP_CLUSTER_MAX; reclaimed = shrink_zone(zone, max_scan, GFP_KERNEL, &total_scanned, ps); reclaim_state->reclaimed_slab = 0; _