Messages in this thread Patch in this message | | | Date | Wed, 21 Dec 2005 13:08:33 -0800 (PST) | From | Christoph Lameter <> | Subject | Zone reclaim V4 [3/3]: Alternate logic without zoned counters |
| |
Reduce frequency of unsuccessful zone reclaim attempts
This is a fallback patch if zoned vm counters are not available. In that case no check for reclaimable pages can be made before starting the scan.
The scan may have to occur for every off node allocation once the node is full. In order to deal with that situation we note the last time a scan has failed and only retry once per tick.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Index: linux-2.6.15-rc5-mm2/mm/vmscan.c =================================================================== --- linux-2.6.15-rc5-mm2.orig/mm/vmscan.c 2005-12-12 16:50:20.000000000 -0800 +++ linux-2.6.15-rc5-mm2/mm/vmscan.c 2005-12-12 16:50:21.000000000 -0800 @@ -1842,6 +1842,16 @@ int zone_reclaim(struct zone *zone, gfp_ atomic_read(&zone->reclaim_in_progress) > 0) return 0; + /* + * If an unsuccessful zone reclaim occurred in this tick then we + * already needed to go off before. Our local purity is already + * tainted and its likely that the scan for easily reclaimable pages + * will be a waste of time. Continue off node allocations for the + * duration of this tick. + */ + if (zone->last_unsuccessful_zone_reclaim == jiffies) + return 0; + sc.gfp_mask = gfp_mask; sc.may_writepage = 0; sc.nr_mapped = read_page_state(nr_mapped); @@ -1859,6 +1869,8 @@ int zone_reclaim(struct zone *zone, gfp_ shrink_zone(zone, &sc); p->reclaim_state = NULL; current->flags &= ~PF_MEMALLOC; + if (sc.nr_reclaimed == 0) + zone->last_unsuccessful_zone_reclaim = jiffies; cond_resched(); return sc.nr_reclaimed >= (1 << order); } Index: linux-2.6.15-rc5-mm2/include/linux/mmzone.h =================================================================== --- linux-2.6.15-rc5-mm2.orig/include/linux/mmzone.h 2005-12-12 09:10:34.000000000 -0800 +++ linux-2.6.15-rc5-mm2/include/linux/mmzone.h 2005-12-12 16:50:21.000000000 -0800 @@ -157,6 +157,8 @@ struct zone { /* A count of how many reclaimers are scanning this zone */ atomic_t reclaim_in_progress; + unsigned long last_unsuccessful_zone_reclaim; + /* * prev_priority holds the scanning priority for this zone. It is * defined as the scanning priority at which we achieved our reclaim - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |