From: Shaohua Li Date: Wed, 24 Aug 2011 23:47:04 +0000 (+1000) Subject: It's possible a zone watermark is ok when entering the balance_pgdat() X-Git-Tag: next-20110905~1^2~72 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=86d1c7fcddc3b6d06a36cb64f8e733e179c76d7c;p=karo-tx-linux.git 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 c9a97ac0d554..0ba2b502c474 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2761,6 +2761,8 @@ out: /* If balanced, clear the congested flag */ zone_clear_flag(zone, ZONE_CONGESTED); + if (i <= *classzone_idx) + balanced += zone->present_pages; } }