From: Mel Gorman Date: Wed, 11 Sep 2013 21:22:19 +0000 (-0700) Subject: mm: compaction: do not compact pgdat for order-0 X-Git-Tag: v3.12-rc1~52^2~197 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3a7200af3d9227767869f451ed747aff07d8df48;p=platform%2Fkernel%2Flinux-stable.git mm: compaction: do not compact pgdat for order-0 If kswapd was reclaiming for a high order and resets it to 0 due to fragmentation it will still call compact_pgdat. For the most part, this will fail a compaction_suitable() test and not compact but it is unnecessarily sloppy. It could be fixed in the caller but fix it in the API instead. [dhillf@gmail.com: pointed out that it was a potential problem] Signed-off-by: Mel Gorman Cc: Hillf Danton Acked-by: Minchan Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/compaction.c b/mm/compaction.c index 05ccb4c..c437893 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1131,6 +1131,9 @@ void compact_pgdat(pg_data_t *pgdat, int order) .sync = false, }; + if (!order) + return; + __compact_pgdat(pgdat, &cc); }