diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2012-12-11 19:02:57 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-11 20:22:27 -0500 |
commit | 2e30abd1730751d58463d88bc0844ab8fd7112a9 (patch) | |
tree | e87bb4b492c1b504dbf5d250fca738e6bdafad12 /mm | |
parent | e1e12d2f3104be886073ac6c5c4678f30b1b9e51 (diff) |
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 <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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/page_alloc.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d9fbac1b5030..265fea4fbc81 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1394,21 +1394,22 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype) | |||
1394 | 1394 | ||
1395 | zone = page_zone(page); | 1395 | zone = page_zone(page); |
1396 | order = page_order(page); | 1396 | order = page_order(page); |
1397 | mt = get_pageblock_migratetype(page); | ||
1397 | 1398 | ||
1398 | /* Obey watermarks as if the page was being allocated */ | 1399 | if (mt != MIGRATE_ISOLATE) { |
1399 | watermark = low_wmark_pages(zone) + (1 << order); | 1400 | /* Obey watermarks as if the page was being allocated */ |
1400 | if (!zone_watermark_ok(zone, 0, watermark, 0, 0)) | 1401 | watermark = low_wmark_pages(zone) + (1 << order); |
1401 | return 0; | 1402 | if (!zone_watermark_ok(zone, 0, watermark, 0, 0)) |
1403 | return 0; | ||
1404 | |||
1405 | __mod_zone_freepage_state(zone, -(1UL << alloc_order), mt); | ||
1406 | } | ||
1402 | 1407 | ||
1403 | /* Remove page from free list */ | 1408 | /* Remove page from free list */ |
1404 | list_del(&page->lru); | 1409 | list_del(&page->lru); |
1405 | zone->free_area[order].nr_free--; | 1410 | zone->free_area[order].nr_free--; |
1406 | rmv_page_order(page); | 1411 | rmv_page_order(page); |
1407 | 1412 | ||
1408 | mt = get_pageblock_migratetype(page); | ||
1409 | if (unlikely(mt != MIGRATE_ISOLATE)) | ||
1410 | __mod_zone_freepage_state(zone, -(1UL << alloc_order), mt); | ||
1411 | |||
1412 | if (alloc_order != order) | 1413 | if (alloc_order != order) |
1413 | expand(zone, page, alloc_order, order, | 1414 | expand(zone, page, alloc_order, order, |
1414 | &zone->free_area[order], migratetype); | 1415 | &zone->free_area[order], migratetype); |