From: Shaohua Li Date: Wed, 5 Oct 2011 00:42:55 +0000 (+1100) Subject: vmscan: count pages into balanced for zone with good watermark X-Git-Tag: next-20111011~1^2~194 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=045a68be655560b3f5440a423e7258847a866c24;p=karo-tx-linux.git vmscan: count pages into balanced for zone with good watermark 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 Acked-by: Mel Gorman Reviewed-by: Minchan Kim Signed-off-by: Andrew Morton --- diff --git a/mm/vmscan.c b/mm/vmscan.c index 20b685267edd..f4e9adf69bca 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2749,6 +2749,8 @@ out: /* If balanced, clear the congested flag */ zone_clear_flag(zone, ZONE_CONGESTED); + if (i <= *classzone_idx) + balanced += zone->present_pages; } }