Possible partial miss in pages needed for zone's memory map?

From: Johannes Weiner
Date: Sat May 17 2008 - 08:19:44 EST


I stumbled over the following in the zone initialization code. Please
let me know if I overlooked something here.


From: Johannes Weiner <hannes@xxxxxxxxxxxx>
Subject: [PATCH] Don't drop a partial page in a zone's memory map size

In a zone's present pages number, account for all pages occupied by the
memory map, including a partial.

Signed-off-by: Johannes Weiner <hannes@xxxxxxxxxxxx>

--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3378,7 +3378,8 @@ static void __paginginit free_area_init_
* is used by this zone for memmap. This affects the watermark
* and per-cpu initialisations
- memmap_pages = (size * sizeof(struct page)) >> PAGE_SHIFT;
+ memmap_pages =
+ PAGE_ALIGN(size * sizeof(struct page)) >> PAGE_SHIFT;
if (realsize >= memmap_pages) {
realsize -= memmap_pages;
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/