diff options
Diffstat (limited to 'arch/x86/mm/discontig_32.c')
-rw-r--r-- | arch/x86/mm/discontig_32.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/x86/mm/discontig_32.c b/arch/x86/mm/discontig_32.c index 88a7499e8e48..9f1d02cfde37 100644 --- a/arch/x86/mm/discontig_32.c +++ b/arch/x86/mm/discontig_32.c | |||
@@ -268,6 +268,7 @@ unsigned long __init setup_memory(void) | |||
268 | { | 268 | { |
269 | int nid; | 269 | int nid; |
270 | unsigned long system_start_pfn, system_max_low_pfn; | 270 | unsigned long system_start_pfn, system_max_low_pfn; |
271 | unsigned long wasted_pages; | ||
271 | 272 | ||
272 | /* | 273 | /* |
273 | * When mapping a NUMA machine we allocate the node_mem_map arrays | 274 | * When mapping a NUMA machine we allocate the node_mem_map arrays |
@@ -292,7 +293,14 @@ unsigned long __init setup_memory(void) | |||
292 | kva_start_pfn = PFN_DOWN(initrd_start - PAGE_OFFSET) | 293 | kva_start_pfn = PFN_DOWN(initrd_start - PAGE_OFFSET) |
293 | - kva_pages; | 294 | - kva_pages; |
294 | #endif | 295 | #endif |
295 | kva_start_pfn -= kva_start_pfn & (PTRS_PER_PTE-1); | 296 | |
297 | /* | ||
298 | * We waste pages past at the end of the KVA for no good reason other | ||
299 | * than how it is located. This is bad. | ||
300 | */ | ||
301 | wasted_pages = kva_start_pfn & (PTRS_PER_PTE-1); | ||
302 | kva_start_pfn -= wasted_pages; | ||
303 | kva_pages += wasted_pages; | ||
296 | 304 | ||
297 | system_max_low_pfn = max_low_pfn = find_max_low_pfn(); | 305 | system_max_low_pfn = max_low_pfn = find_max_low_pfn(); |
298 | printk("kva_start_pfn ~ %ld find_max_low_pfn() ~ %ld\n", | 306 | printk("kva_start_pfn ~ %ld find_max_low_pfn() ~ %ld\n", |
@@ -345,7 +353,8 @@ unsigned long __init setup_memory(void) | |||
345 | 353 | ||
346 | void __init numa_kva_reserve(void) | 354 | void __init numa_kva_reserve(void) |
347 | { | 355 | { |
348 | reserve_bootmem(PFN_PHYS(kva_start_pfn),PFN_PHYS(kva_pages)); | 356 | if (kva_pages) |
357 | reserve_bootmem(PFN_PHYS(kva_start_pfn), PFN_PHYS(kva_pages)); | ||
349 | } | 358 | } |
350 | 359 | ||
351 | void __init zone_sizes_init(void) | 360 | void __init zone_sizes_init(void) |