Commit 9c8c9492 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] vmscan: reset refill_counter after refilling the inactive list

zone->refill_counter is only there to provide decent levels of work batching:
don't call refill_inactive_zone() just for a couple of pages.

But the logic in there allows it to build up to huge values and it can
overflow (go negative) which will disable refilling altogether until it wraps
positive again.

Just reset it to zero whenever we decide to do some refilling.
parent 6f222020
......@@ -779,7 +779,7 @@ shrink_zone(struct zone *zone, int max_scan, unsigned int gfp_mask,
count = atomic_read(&zone->refill_counter);
if (count > SWAP_CLUSTER_MAX * 4)
count = SWAP_CLUSTER_MAX * 4;
atomic_sub(count, &zone->refill_counter);
atomic_set(&zone->refill_counter, 0);
refill_inactive_zone(zone, count, ps, priority);
}
return shrink_cache(nr_pages, zone, gfp_mask,
......
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