diff -aurpN -X /home/mbligh/.diff.exclude linux-2.6.18/mm/vmscan.c 2.6.18-prev_reset/mm/vmscan.c --- linux-2.6.18/mm/vmscan.c 2006-09-20 12:24:42.000000000 -0700 +++ 2.6.18-prev_reset/mm/vmscan.c 2006-10-16 17:23:48.000000000 -0700 @@ -962,7 +962,6 @@ static unsigned long shrink_zones(int pr unsigned long try_to_free_pages(struct zone **zones, gfp_t gfp_mask) { int priority; - int ret = 0; unsigned long total_scanned = 0; unsigned long nr_reclaimed = 0; struct reclaim_state *reclaim_state = current->reclaim_state; @@ -1000,8 +999,15 @@ unsigned long try_to_free_pages(struct z } total_scanned += sc.nr_scanned; if (nr_reclaimed >= sc.swap_cluster_max) { - ret = 1; - goto out; + for (i = 0; zones[i] != 0; i++) { + struct zone *zone = zones[i]; + + if (!cpuset_zone_allowed(zone, __GFP_HARDWALL)) + continue; + + zone->prev_priority = zone->temp_priority; + } + return 1; } /* @@ -1021,16 +1027,15 @@ unsigned long try_to_free_pages(struct z if (sc.nr_scanned && priority < DEF_PRIORITY - 2) blk_congestion_wait(WRITE, HZ/10); } -out: for (i = 0; zones[i] != 0; i++) { struct zone *zone = zones[i]; if (!cpuset_zone_allowed(zone, __GFP_HARDWALL)) continue; - zone->prev_priority = zone->temp_priority; + zone->prev_priority = 0; } - return ret; + return 0; } /* @@ -1186,7 +1191,10 @@ out: for (i = 0; i < pgdat->nr_zones; i++) { struct zone *zone = pgdat->node_zones + i; - zone->prev_priority = zone->temp_priority; + if (priority < 0) /* we failed to reclaim */ + zone->prev_priority = 0; + else + zone->prev_priority = zone->temp_priority; } if (!all_zones_ok) { cond_resched();