Commit 08556c97 authored by Gavin Guo's avatar Gavin Guo Committed by Seth Forshee

UBUNTU: SAUCE: (no-up) If zone is so small that watermarks are the same, stop zone balance.

BugLink: http://bugs.launchpad.net/bugs/1518457

On an AWS t2.micro instance (Xeon E5-2670, 991MiB of memory).
Occasionally (about once a day), kswapd0 falls into a busy loop and
spins on 100% CPU usage indefinitely. Reject to do the zone balance
when the memory is too small.
Signed-off-by: default avatarDan Streetman <dan.streetman@canonical.com>
Signed-off-by: default avatarGavin Guo <gavin.guo@canonical.com>
Tested-by: default avatarJay Vosburgh <jay.vosburgh@canonical.com>
Acked-by: default avatarLeann Ogasawara <leann.ogasawara@canonical.com>
Acked-by: default avatarBrad Figg <brad.figg@canonical.com>
Signed-off-by: default avatarSeth Forshee <seth.forshee@canonical.com>
parent 8d796174
......@@ -2959,6 +2959,13 @@ static void age_active_anon(struct zone *zone, struct scan_control *sc)
static bool zone_balanced(struct zone *zone, int order,
unsigned long balance_gap, int classzone_idx)
{
/*
* if zone is so small that watermarks are the same, don't bother trying
* to balance; kswapd would just spin continuously trying to balance it.
*/
if (low_wmark_pages(zone) == high_wmark_pages(zone))
return true;
if (!zone_watermark_ok_safe(zone, order, high_wmark_pages(zone) +
balance_gap, classzone_idx))
return false;
......
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