[3.16.y-ckt stable] Patch "mm/compaction: fix wrong order check in compact_finished()" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Mon Mar 2 13:37:30 UTC 2015

This is a note to let you know that I have just added a patch titled

    mm/compaction: fix wrong order check in compact_finished()

to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree 
which can be found at:


This patch is scheduled to be released in version 3.16.7-ckt8.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.16.y-ckt tree, see



>From 21239c26753bfdfb32cedcb319479b89534d1450 Mon Sep 17 00:00:00 2001
From: Joonsoo Kim <iamjoonsoo.kim at lge.com>
Date: Thu, 12 Feb 2015 14:59:50 -0800
Subject: mm/compaction: fix wrong order check in compact_finished()

commit 372549c2a3778fd3df445819811c944ad54609ca upstream.

What we want to check here is whether there is highorder freepage in buddy
list of other migratetype in order to steal it without fragmentation.
But, current code just checks cc->order which means allocation request
order.  So, this is wrong.

Without this fix, non-movable synchronous compaction below pageblock order
would not stopped until compaction is complete, because migratetype of
most pageblocks are movable and high order freepage made by compaction is
usually on movable type buddy list.

There is some report related to this bug. See below link.


Although the issued system still has load spike comes from compaction,
this makes that system completely stable and responsive according to his

stress-highalloc test in mmtests with non movable order 7 allocation
doesn't show any notable difference in allocation success rate, but, it
shows more compaction success rate.

Compaction success rate (Compaction success * 100 / Compaction stalls, %)
18.47 : 28.94

Fixes: 1fb3f8ca0e92 ("mm: compaction: capture a suitable high-order page immediately when it is made available")
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim at lge.com>
Acked-by: Vlastimil Babka <vbabka at suse.cz>
Reviewed-by: Zhang Yanfei <zhangyanfei at cn.fujitsu.com>
Cc: Mel Gorman <mgorman at suse.de>
Cc: David Rientjes <rientjes at google.com>
Cc: Rik van Riel <riel at redhat.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
 mm/compaction.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index 21bf292b642a..c7c6ae59f787 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -937,7 +937,7 @@ static int compact_finished(struct zone *zone,

 		/* Job done if allocation would set block type */
-		if (cc->order >= pageblock_order && area->nr_free)
+		if (order >= pageblock_order && area->nr_free)

More information about the kernel-team mailing list