From: Marek Szyprowski Date: Thu, 29 Nov 2012 03:17:28 +0000 (+1100) Subject: mm: cma: skip watermarks check for already isolated blocks in split_free_page() X-Git-Tag: next-20121205~1^2~292 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b59d530a1b8ce20969e116e40a9e30fe8e181999;p=karo-tx-linux.git mm: cma: skip watermarks check for already isolated blocks in split_free_page() 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 Cc: Kyungmin Park Cc: Arnd Bergmann Cc: Mel Gorman Acked-by: Michal Nazarewicz Cc: Minchan Kim Cc: Bartlomiej Zolnierkiewicz Signed-off-by: Andrew Morton --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index b1fdde5439c9..54a2224649db 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -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);