]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
UBUNTU: SAUCE: (no-up) If zone is so small that watermarks are the same, stop zone...
authorGavin Guo <gavin.guo@canonical.com>
Wed, 12 Oct 2016 01:13:35 +0000 (09:13 +0800)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Feb 2017 03:57:58 +0000 (20:57 -0700)
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: Dan Streetman <dan.streetman@canonical.com>
Signed-off-by: Gavin Guo <gavin.guo@canonical.com>
Tested-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Acked-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
mm/vmscan.c

index 532a2a750952daffed4e4242d36a449eb9ba8837..461ec919211528f6f35194c814eab7ccb42e2ec9 100644 (file)
@@ -3094,6 +3094,13 @@ static bool zone_balanced(struct zone *zone, int order, int classzone_idx)
 {
        unsigned long mark = high_wmark_pages(zone);
 
+       /*
+        * 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) == mark)
+               return true;
+
        if (!zone_watermark_ok_safe(zone, order, mark, classzone_idx))
                return false;