Commit 14d927a3 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] vmscan: use zone_pressure for page unmapping

From: Nikita Danilov <Nikita@Namesys.COM>

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.
parent ecbeb4b2
......@@ -93,6 +93,11 @@ static void zone_adj_pressure(struct zone *zone, int priority)
(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, const int nr_pages_in,
* `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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment