mm: fix page_group_by_mobility_disabled breakage
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Tue, 12 Nov 2013 23:08:18 +0000 (15:08 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 13 Nov 2013 03:09:09 +0000 (12:09 +0900)
Currently, set_pageblock_migratetype() screws up MIGRATE_CMA and
MIGRATE_ISOLATE if page_group_by_mobility_disabled is true.  It rewrites
the argument to MIGRATE_UNMOVABLE and we lost these attribute.

The problem was introduced by commit 49255c619fbd ("page allocator: move
check for disabled anti-fragmentation out of fastpath").  So a 4 year
old issue may mean that nobody uses page_group_by_mobility_disabled.

But anyway, this patch fixes the problem.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/page_alloc.c

index 770dbb43465f525d4d50a720a58a7a89a062c343..5a9883614d996857ecb19810fb1edd9ec7f60d6c 100644 (file)
@@ -234,8 +234,8 @@ int page_group_by_mobility_disabled __read_mostly;
 
 void set_pageblock_migratetype(struct page *page, int migratetype)
 {
-
-       if (unlikely(page_group_by_mobility_disabled))
+       if (unlikely(page_group_by_mobility_disabled &&
+                    migratetype < MIGRATE_PCPTYPES))
                migratetype = MIGRATE_UNMOVABLE;
 
        set_pageblock_flags_group(page, (unsigned long)migratetype,