]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: cma: skip watermarks check for already isolated blocks in split_free_page()
authorMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 9 Nov 2012 03:04:34 +0000 (14:04 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 13 Nov 2012 05:15:39 +0000 (16:15 +1100)
Since commit 2139cbe627b8 ("cma: fix counting of isolated pages") free
pages in isolated pageblocks are not accounted to NR_FREE_PAGES counters,
so watermarks check is not required if one operates on a free page in
isolated pageblock.

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>
Acked-by: 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 d61aaadc1e61bc0ebe3337efb4f9c804d905e610..43f48535bd376c4d96126bbba598b062964ad898 100644 (file)
@@ -1394,10 +1394,12 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype)
        zone = page_zone(page);
        order = page_order(page);
 
-       /* 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;
+       if (get_pageblock_migratetype(page) != 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;
+       }
 
        /* Remove page from free list */
        list_del(&page->lru);