From: Marek Szyprowski Date: Tue, 12 Feb 2013 21:46:24 +0000 (-0800) Subject: mm: cma: fix accounting of CMA pages placed in high memory X-Git-Tag: submit/tizen/20141203.153721~2909 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41a7973447b0b8717f0a214d4328dc31ec2291d7;p=platform%2Fkernel%2Flinux-arm64.git mm: cma: fix accounting of CMA pages placed in high memory The total number of low memory pages is determined as totalram_pages - totalhigh_pages, so without this patch all CMA pageblocks placed in highmem were accounted to low memory. Signed-off-by: Marek Szyprowski Acked-by: Kyungmin Park Cc: Minchan Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index df2022ff0c8..9673d96b1ba 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -773,6 +773,10 @@ void __init init_cma_reserved_pageblock(struct page *page) set_pageblock_migratetype(page, MIGRATE_CMA); __free_pages(page, pageblock_order); totalram_pages += pageblock_nr_pages; +#ifdef CONFIG_HIGHMEM + if (PageHighMem(page)) + totalhigh_pages += pageblock_nr_pages; +#endif } #endif