On 01/28/2011 11:46 AM, Mel Gorman wrote:
On Fri, Jan 28, 2011 at 05:28:31PM +0100, Andrea Arcangeli wrote:
In previous email you asked me how kswapd get stuck in D state and
never stops working, and that it should stop earlier. This sounds
impossible, kswapd behavior can't possibly change, simply there is
less memory freed by lowering that "gap".
There might be less memory freed by lowering that gap but it still needs to
exit balance_pgdat() and go to sleep. Otherwise it'll keep freeing zones up
to the high watermark + gap and calling congestion_wait (hence the D state).
The gap works because kswapd has different thresholds for
different things:
1) get woken up if every zone on an allocator's zone list
is below the low watermark
2) exit the loop if _every_ zone is at or above the
high watermark
3) skip a zone in the freeing loop if the zone has more
than high + gap free memory
Continuing the loop as long as one zone is below the low
watermark is what equalizes memory pressure between zones.
Skipping the freeing of pages in a zone that already has
excessive amounts of free memory helps avoid memory waste
and excessive swapping. We simply equalize the balance
between zones a little more slowly. What matters is that
the memory pressure gets equalized over time.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>