From: Nikita Danilov Use zone->pressure (rathar than scanning priority) to determine when to start reclaiming mapped pages in refill_inactive_zone(). When using priority every call to try_to_free_pages() starts with scanning parts of active list and skipping mapped pages (because reclaim_mapped evaluates to 0 on low priorities) no matter how high memory pressure is. mm/vmscan.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletion(-) diff -puN mm/vmscan.c~reclaim-mapped-pressure mm/vmscan.c --- 25/mm/vmscan.c~reclaim-mapped-pressure 2003-07-26 21:59:53.000000000 -0700 +++ 25-akpm/mm/vmscan.c 2003-07-26 21:59:53.000000000 -0700 @@ -93,6 +93,11 @@ static void zone_adj_pressure(struct zon (DEF_PRIORITY - priority) << 10); } +static int pressure_to_priority(int pressure) +{ + return DEF_PRIORITY - (pressure >> 10); +} + /* * The list of shrinker callbacks used by to apply pressure to * ageable caches. @@ -611,7 +616,7 @@ refill_inactive_zone(struct zone *zone, * `distress' is a measure of how much trouble we're having reclaiming * pages. 0 -> no problems. 100 -> great trouble. */ - distress = 100 >> priority; + distress = 100 >> pressure_to_priority(zone->pressure); /* * The point of this algorithm is to decide when to start reclaiming _