From: Wen Congyang Date: Fri, 9 Nov 2012 03:04:01 +0000 (+1100) Subject: memory-hotplug: fix NR_FREE_PAGES mismatch's fix X-Git-Tag: next-20121109~9^2~241 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=98c79c4d9751148a4afc7689fc5f9462f46e6e53;p=karo-tx-linux.git memory-hotplug: fix NR_FREE_PAGES mismatch's fix When a page is freed and put into pcp list, get_freepage_migratetype() doesn't return MIGRATE_ISOLATE even if this pageblock is isolated. So we should use get_freepage_migratetype() instead of mt to check whether it is isolated. Signed-off-by: Wen Congyang Reported-by: Jianguo Wu Signed-off-by: Andrew Morton --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ad7d670b662f..fb1f9311f1fd 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -666,7 +666,7 @@ static void free_pcppages_bulk(struct zone *zone, int count, /* MIGRATE_MOVABLE list may include MIGRATE_RESERVEs */ __free_one_page(page, zone, 0, mt); trace_mm_page_pcpu_drain(page, 0, mt); - if (likely(mt != MIGRATE_ISOLATE)) { + if (likely(get_pageblock_migratetype(page) != MIGRATE_ISOLATE)) { __mod_zone_page_state(zone, NR_FREE_PAGES, 1); if (is_migrate_cma(mt)) __mod_zone_page_state(zone, NR_FREE_CMA_PAGES, 1);