aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2012-10-08 19:32:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-09 03:22:44 -0400
commit2139cbe627b8910ded55148f87ee10f7485408ed (patch)
treee42678cc486717e39391bfc71ca0e5671468210e /mm/page_alloc.c
parent770c8aaaf6f04a87e6765f24d497132de9152a46 (diff)
cma: fix counting of isolated pages
Isolated free pages shouldn't be accounted to NR_FREE_PAGES counter. Fix it by properly decreasing/increasing NR_FREE_PAGES counter in set_migratetype_isolate()/unset_migratetype_isolate() and removing counter adjustment for isolated pages from free_one_page() and split_free_page(). Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Michal Nazarewicz <mina86@mina86.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 3f18a14effb8..d259cc2b69c1 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -691,7 +691,8 @@ static void free_one_page(struct zone *zone, struct page *page, int order,
691 zone->pages_scanned = 0; 691 zone->pages_scanned = 0;
692 692
693 __free_one_page(page, zone, order, migratetype); 693 __free_one_page(page, zone, order, migratetype);
694 __mod_zone_page_state(zone, NR_FREE_PAGES, 1 << order); 694 if (unlikely(migratetype != MIGRATE_ISOLATE))
695 __mod_zone_page_state(zone, NR_FREE_PAGES, 1 << order);
695 spin_unlock(&zone->lock); 696 spin_unlock(&zone->lock);
696} 697}
697 698
@@ -1392,6 +1393,7 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype)
1392 unsigned int order; 1393 unsigned int order;
1393 unsigned long watermark; 1394 unsigned long watermark;
1394 struct zone *zone; 1395 struct zone *zone;
1396 int mt;
1395 1397
1396 BUG_ON(!PageBuddy(page)); 1398 BUG_ON(!PageBuddy(page));
1397 1399
@@ -1407,7 +1409,10 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype)
1407 list_del(&page->lru); 1409 list_del(&page->lru);
1408 zone->free_area[order].nr_free--; 1410 zone->free_area[order].nr_free--;
1409 rmv_page_order(page); 1411 rmv_page_order(page);
1410 __mod_zone_page_state(zone, NR_FREE_PAGES, -(1UL << order)); 1412
1413 mt = get_pageblock_migratetype(page);
1414 if (unlikely(mt != MIGRATE_ISOLATE))
1415 __mod_zone_page_state(zone, NR_FREE_PAGES, -(1UL << order));
1411 1416
1412 if (alloc_order != order) 1417 if (alloc_order != order)
1413 expand(zone, page, alloc_order, order, 1418 expand(zone, page, alloc_order, order,