]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Balance inter-zone scan rates
authorAndrew Morton <akpm@osdl.org>
Fri, 12 Mar 2004 00:24:10 +0000 (16:24 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 12 Mar 2004 00:24:10 +0000 (16:24 -0800)
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

index fdca9b23bb9b9028b52e086ee5be14ff32650671..ba9be09720888753bee7e0e138dc4d697d42b3ff 100644 (file)
@@ -807,8 +807,7 @@ shrink_caches(struct zone **zones, int priority, int *total_scanned,
                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;
@@ -932,8 +931,6 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages, struct page_state *ps)
                        }
                        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;