diff options
author | Tony Luck <tony.luck@intel.com> | 2015-11-10 13:09:47 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-10 17:44:26 -0500 |
commit | b0aeba741b2d082e4f0773881af4906ce2bb8231 (patch) | |
tree | 54aa8f78967e60d869d4502ab4554aae4676d6b9 /mm/page_alloc.c | |
parent | 3934bbc0446e4cae977a6efe82ce993d37434e53 (diff) |
Fix alloc_node_mem_map() to work on ia64 again
In commit a1c34a3bf00a ("mm: Don't offset memmap for flatmem") Laura
fixed a problem for Srinivas relating to the bottom 2MB of RAM on an ARM
IFC6410 board.
One small wrinkle on ia64 is that it allocates the node_mem_map earlier
in arch code, so it skips the block of code where "offset" is
initialized.
Move initialization of start and offset before the check for the
node_mem_map so that they will always be available in the latter part of
the function.
Tested-by: Laura Abbott <laura@labbott.name>
Fixes: a1c34a3bf00a (mm: Don't offset memmap for flatmem)
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 208e4c7e771b..17a3c66639a9 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -5266,6 +5266,7 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat) | |||
5266 | 5266 | ||
5267 | static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat) | 5267 | static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat) |
5268 | { | 5268 | { |
5269 | unsigned long __maybe_unused start = 0; | ||
5269 | unsigned long __maybe_unused offset = 0; | 5270 | unsigned long __maybe_unused offset = 0; |
5270 | 5271 | ||
5271 | /* Skip empty nodes */ | 5272 | /* Skip empty nodes */ |
@@ -5273,9 +5274,11 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat) | |||
5273 | return; | 5274 | return; |
5274 | 5275 | ||
5275 | #ifdef CONFIG_FLAT_NODE_MEM_MAP | 5276 | #ifdef CONFIG_FLAT_NODE_MEM_MAP |
5277 | start = pgdat->node_start_pfn & ~(MAX_ORDER_NR_PAGES - 1); | ||
5278 | offset = pgdat->node_start_pfn - start; | ||
5276 | /* ia64 gets its own node_mem_map, before this, without bootmem */ | 5279 | /* ia64 gets its own node_mem_map, before this, without bootmem */ |
5277 | if (!pgdat->node_mem_map) { | 5280 | if (!pgdat->node_mem_map) { |
5278 | unsigned long size, start, end; | 5281 | unsigned long size, end; |
5279 | struct page *map; | 5282 | struct page *map; |
5280 | 5283 | ||
5281 | /* | 5284 | /* |
@@ -5283,8 +5286,6 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat) | |||
5283 | * aligned but the node_mem_map endpoints must be in order | 5286 | * aligned but the node_mem_map endpoints must be in order |
5284 | * for the buddy allocator to function correctly. | 5287 | * for the buddy allocator to function correctly. |
5285 | */ | 5288 | */ |
5286 | start = pgdat->node_start_pfn & ~(MAX_ORDER_NR_PAGES - 1); | ||
5287 | offset = pgdat->node_start_pfn - start; | ||
5288 | end = pgdat_end_pfn(pgdat); | 5289 | end = pgdat_end_pfn(pgdat); |
5289 | end = ALIGN(end, MAX_ORDER_NR_PAGES); | 5290 | end = ALIGN(end, MAX_ORDER_NR_PAGES); |
5290 | size = (end - start) * sizeof(struct page); | 5291 | size = (end - start) * sizeof(struct page); |