public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: cma: fix accounting of CMA pages placed in high memory
@ 2013-02-04 10:27 Marek Szyprowski
  2013-02-04 23:06 ` Andrew Morton
  2013-02-04 23:34 ` Minchan Kim
  0 siblings, 2 replies; 16+ messages in thread
From: Marek Szyprowski @ 2013-02-04 10:27 UTC (permalink / raw)
  To: linux-mm, linux-kernel
  Cc: m.szyprowski, akpm, minchan, mgorman, kyungmin.park

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 <m.szyprowski@samsung.com>
---
 mm/page_alloc.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index f5bab0a..6415d93 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
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2013-02-20  5:31 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-04 10:27 [PATCH] mm: cma: fix accounting of CMA pages placed in high memory Marek Szyprowski
2013-02-04 23:06 ` Andrew Morton
2013-02-04 23:29   ` Kyungmin Park
2013-02-04 23:43     ` Minchan Kim
2013-02-04 23:52       ` Kyungmin Park
2013-02-05  0:40         ` Minchan Kim
2013-02-05  8:38           ` Marek Szyprowski
2013-02-05  8:47             ` Minchan Kim
2013-02-05  8:28     ` Mel Gorman
2013-02-05  8:56       ` Marek Szyprowski
2013-02-04 23:34 ` Minchan Kim
2013-02-05  7:10   ` Marek Szyprowski
2013-02-05  7:34     ` Minchan Kim
2013-02-19 13:27     ` Simon Jeons
2013-02-20  2:57       ` Kyungmin Park
2013-02-20  5:31         ` Simon Jeons

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox