]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
vmscan: count pages into balanced for zone with good watermark
authorShaohua Li <shaohua.li@intel.com>
Wed, 5 Oct 2011 00:42:55 +0000 (11:42 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 7 Oct 2011 06:06:36 +0000 (17:06 +1100)
It's possible a zone watermark is ok when entering the balance_pgdat()
loop, while the zone is within the requested classzone_idx.  Count pages
from this zone into `balanced'.  In this way, we can skip shrinking zones
too much for high order allocation.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vmscan.c

index a297603d35bc06a401ab2a4bb16f7f8f1d5d5d3a..77ee24fc891aed4b362e6a728bb36172583e1ecd 100644 (file)
@@ -2748,6 +2748,8 @@ out:
 
                        /* If balanced, clear the congested flag */
                        zone_clear_flag(zone, ZONE_CONGESTED);
+                       if (i <= *classzone_idx)
+                               balanced += zone->present_pages;
                }
        }