From: Peter Zijlstra Remove the dependency on struct scan_control from refill_inactive_zone so we can move it into the page replace file which doesn't know anything about scan_control. Signed-off-by: Peter Zijlstra mm/vmscan.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) Index: linux-2.6-uml/mm/vmscan.c =================================================================== --- linux-2.6-uml.orig/mm/vmscan.c 2006-02-23 22:02:03.000000000 +0100 +++ linux-2.6-uml/mm/vmscan.c 2006-02-23 22:02:08.000000000 +0100 @@ -61,8 +61,6 @@ struct scan_control { /* Incremented by the number of pages reclaimed */ unsigned long nr_reclaimed; - unsigned long nr_mapped; /* From page_state */ - /* Ask shrink_caches, or shrink_zone to scan at this priority */ unsigned int priority; @@ -973,7 +971,7 @@ static void shrink_cache(struct zone *zo * But we had to alter page->flags anyway. */ static void -refill_inactive_zone(struct zone *zone, struct scan_control *sc) +refill_inactive_zone(struct zone *zone, int nr_pages) { int pgmoved; int pgdeactivate = 0; @@ -1003,7 +1001,7 @@ refill_inactive_zone(struct zone *zone, * how much memory * is mapped. */ - mapped_ratio = (sc->nr_mapped * 100) / total_memory; + mapped_ratio = (read_page_state(nr_mapped) * 100) / total_memory; /* * Now decide how much we really want to unmap some pages. The @@ -1029,7 +1027,7 @@ refill_inactive_zone(struct zone *zone, page_replace_add_drain(); spin_lock_irq(&zone->lru_lock); - pgmoved = isolate_lru_pages(sc->nr_to_scan, &zone->active_list, + pgmoved = isolate_lru_pages(nr_pages, &zone->active_list, &l_hold, &pgscanned); zone->pages_scanned += pgscanned; zone->nr_active -= pgmoved; @@ -1138,7 +1136,7 @@ shrink_zone(struct zone *zone, struct sc while (nr_active >= SWAP_CLUSTER_MAX * 1024 || nr_inactive) { if (nr_active >= SWAP_CLUSTER_MAX * 1024) { nr_active -= SWAP_CLUSTER_MAX * 1024; - refill_inactive_zone(zone, sc); + refill_inactive_zone(zone, sc->nr_to_scan); } if (nr_inactive) { @@ -1238,7 +1236,6 @@ int try_to_free_pages(struct zone **zone } for (priority = DEF_PRIORITY; priority >= 0; priority--) { - sc.nr_mapped = read_page_state(nr_mapped); sc.nr_scanned = 0; sc.nr_reclaimed = 0; sc.priority = priority; @@ -1327,7 +1324,6 @@ loop_again: sc.gfp_mask = GFP_KERNEL; sc.may_writepage = !laptop_mode; sc.may_swap = 1; - sc.nr_mapped = read_page_state(nr_mapped); inc_page_state(pageoutrun);