aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bogendoerfer <[email protected]>2008-01-08 15:33:11 -0800
committerLinus Torvalds <[email protected]>2008-01-08 16:10:36 -0800
commit467bc461d2845f6a04b124bca1ae6ecc554e1ee5 (patch)
tree060bed1cbd2440486d2abaafd8f0f2b8e6b9f76b
parent22a860a9e22fa077300e1e72170afb82bf695617 (diff)
Fix crash with FLAT_MEMORY and ARCH_PFN_OFFSET != 0
When using FLAT_MEMORY and ARCH_PFN_OFFSET is not 0, the kernel crashes in memmap_init_zone(). This bug got introduced by commit c713216deebd95d2b0ab38fef8bb2361c0180c2d Signed-off-by: Thomas Bogendoerfer <[email protected]> Acked-by: Mel Gorman <[email protected]> Cc: Bob Picco <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Andy Whitcroft <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: "Keith Mannthey" <[email protected]> Cc: "Luck, Tony" <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Cc: Yasunori Goto <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/page_alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d73bfad1c32f..e1028fae3ebb 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3438,7 +3438,7 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat)
mem_map = NODE_DATA(0)->node_mem_map;
#ifdef CONFIG_ARCH_POPULATES_NODE_MAP
if (page_to_pfn(mem_map) != pgdat->node_start_pfn)
- mem_map -= pgdat->node_start_pfn;
+ mem_map -= (pgdat->node_start_pfn - ARCH_PFN_OFFSET);
#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */
}
#endif