From: Christoph Lameter Conversion of nr_mapped to a per zone counter nr_mapped is important because it allows a determination how many pages of a zone are not mapped, which would allow a more efficient means of determining when we need to reclaim memory in a zone. We take the nr_mapped field out of the page state structure and define a new per zone counter named NR_MAPPED. We replace the use of nr_mapped in various kernel locations. This avoids the looping over all processors in try_to_free_pages(), writeback, reclaim (swap + zone reclaim). Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton --- mm/swap_prefetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN mm/swap_prefetch.c~swap_prefetch-conversion-of-nr_mapped-to-per-zone-counter mm/swap_prefetch.c --- devel/mm/swap_prefetch.c~swap_prefetch-conversion-of-nr_mapped-to-per-zone-counter 2006-06-09 02:50:18.000000000 -0700 +++ devel-akpm/mm/swap_prefetch.c 2006-06-09 02:50:18.000000000 -0700 @@ -394,7 +394,7 @@ static int prefetch_suitable(void) * even if the slab is being allocated on a remote node. This * would be expensive to fix and not of great significance. */ - limit = ps.nr_mapped + ps.nr_slab + ps.nr_dirty + + limit = global_page_state(NR_MAPPED) + ps.nr_slab + ps.nr_dirty + ps.nr_unstable + total_swapcache_pages; if (limit > ns->prefetch_watermark) { node_clear(node, sp_stat.prefetch_nodes); _