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.


 25-akpm/mm/vmscan.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN mm/vmscan.c~refill_counter-overflow-fix mm/vmscan.c
--- 25/mm/vmscan.c~refill_counter-overflow-fix	Tue Oct 28 15:25:50 2003
+++ 25-akpm/mm/vmscan.c	Tue Oct 28 15:26:01 2003
@@ -779,7 +779,7 @@ shrink_zone(struct zone *zone, int max_s
 		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,

_