]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: cma: skip watermarks check for already isolated blocks in split_free_page() fix
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 29 Nov 2012 03:17:29 +0000 (14:17 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 5 Dec 2012 05:23:11 +0000 (16:23 +1100)
Cleanup and simplify the code which uses page migrate type.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Michal Nazarewicz <mina86@mina86.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c

index 54a2224649db322e4877489e8392324554338b79..61280ff404392c18c1a82dea399b783020ee9e5f 100644 (file)
@@ -1393,12 +1393,15 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype)
 
        zone = page_zone(page);
        order = page_order(page);
+       mt = get_pageblock_migratetype(page);
 
-       if (get_pageblock_migratetype(page) != MIGRATE_ISOLATE) {
+       if (mt != MIGRATE_ISOLATE) {
                /* Obey watermarks as if the page was being allocated */
                watermark = low_wmark_pages(zone) + (1 << order);
                if (!zone_watermark_ok(zone, 0, watermark, 0, 0))
                        return 0;
+
+               __mod_zone_freepage_state(zone, -(1UL << order), mt);
        }
 
        /* Remove page from free list */
@@ -1406,10 +1409,6 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype)
        zone->free_area[order].nr_free--;
        rmv_page_order(page);
 
-       mt = get_pageblock_migratetype(page);
-       if (unlikely(mt != MIGRATE_ISOLATE))
-               __mod_zone_freepage_state(zone, -(1UL << alloc_order), mt);
-
        if (alloc_order != order)
                expand(zone, page, alloc_order, order,
                        &zone->free_area[order], migratetype);