Commit e5f02647 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Balance inter-zone scan rates

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.
parent 5954a8b0
...@@ -807,8 +807,7 @@ shrink_caches(struct zone **zones, int priority, int *total_scanned, ...@@ -807,8 +807,7 @@ shrink_caches(struct zone **zones, int priority, int *total_scanned,
if (zone->all_unreclaimable && priority != DEF_PRIORITY) if (zone->all_unreclaimable && priority != DEF_PRIORITY)
continue; /* Let kswapd poll it */ continue; /* Let kswapd poll it */
max_scan = max(zone->nr_inactive >> priority, max_scan = zone->nr_inactive >> priority;
SWAP_CLUSTER_MAX * 2UL);
ret += shrink_zone(zone, max_scan, gfp_mask, total_scanned, ps); ret += shrink_zone(zone, max_scan, gfp_mask, total_scanned, ps);
} }
return ret; return ret;
...@@ -932,8 +931,6 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages, struct page_state *ps) ...@@ -932,8 +931,6 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages, struct page_state *ps)
} }
zone->temp_priority = priority; zone->temp_priority = priority;
max_scan = zone->nr_inactive >> 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, reclaimed = shrink_zone(zone, max_scan, GFP_KERNEL,
&total_scanned, ps); &total_scanned, ps);
reclaim_state->reclaimed_slab = 0; reclaim_state->reclaimed_slab = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment