diff options
author | Yinghai Lu <yhlu.kernel.send@gmail.com> | 2008-03-23 03:16:49 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-03-26 17:23:41 -0400 |
commit | 76c324182bbd29dfe4298ca65efb15be18055df1 (patch) | |
tree | 7dcdd3aded048ab8613f532140d1d5bad14e4621 /arch | |
parent | 923a0cf82f2b504e316642e2d152d38b6c0be4ba (diff) |
x86: fix trim mtrr not to setup_memory two times
we could call find_max_pfn() directly instead of setup_memory() to get
max_pfn needed for mtrr trimming.
otherwise setup_memory() is called two times... that is duplicated...
[ mingo@elte.hu: both Thomas and me simulated a double call to
setup_bootmem_allocator() and can confirm that it is a real bug
which can hang in certain configs. It's not been reported yet but
that is probably due to the relatively scarce nature of
MTRR-trimming systems. ]
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/setup_32.c | 9 | ||||
-rw-r--r-- | arch/x86/mm/discontig_32.c | 1 |
2 files changed, 4 insertions, 6 deletions
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c index a1d7071a51c9..2b3e5d45176b 100644 --- a/arch/x86/kernel/setup_32.c +++ b/arch/x86/kernel/setup_32.c | |||
@@ -406,8 +406,6 @@ static unsigned long __init setup_memory(void) | |||
406 | */ | 406 | */ |
407 | min_low_pfn = PFN_UP(init_pg_tables_end); | 407 | min_low_pfn = PFN_UP(init_pg_tables_end); |
408 | 408 | ||
409 | find_max_pfn(); | ||
410 | |||
411 | max_low_pfn = find_max_low_pfn(); | 409 | max_low_pfn = find_max_low_pfn(); |
412 | 410 | ||
413 | #ifdef CONFIG_HIGHMEM | 411 | #ifdef CONFIG_HIGHMEM |
@@ -764,12 +762,13 @@ void __init setup_arch(char **cmdline_p) | |||
764 | if (efi_enabled) | 762 | if (efi_enabled) |
765 | efi_init(); | 763 | efi_init(); |
766 | 764 | ||
767 | max_low_pfn = setup_memory(); | ||
768 | |||
769 | /* update e820 for memory not covered by WB MTRRs */ | 765 | /* update e820 for memory not covered by WB MTRRs */ |
766 | find_max_pfn(); | ||
770 | mtrr_bp_init(); | 767 | mtrr_bp_init(); |
771 | if (mtrr_trim_uncached_memory(max_pfn)) | 768 | if (mtrr_trim_uncached_memory(max_pfn)) |
772 | max_low_pfn = setup_memory(); | 769 | find_max_pfn(); |
770 | |||
771 | max_low_pfn = setup_memory(); | ||
773 | 772 | ||
774 | #ifdef CONFIG_VMI | 773 | #ifdef CONFIG_VMI |
775 | /* | 774 | /* |
diff --git a/arch/x86/mm/discontig_32.c b/arch/x86/mm/discontig_32.c index c394ca0720b8..8e25e06ff730 100644 --- a/arch/x86/mm/discontig_32.c +++ b/arch/x86/mm/discontig_32.c | |||
@@ -324,7 +324,6 @@ unsigned long __init setup_memory(void) | |||
324 | * this space and use it to adjust the boundary between ZONE_NORMAL | 324 | * this space and use it to adjust the boundary between ZONE_NORMAL |
325 | * and ZONE_HIGHMEM. | 325 | * and ZONE_HIGHMEM. |
326 | */ | 326 | */ |
327 | find_max_pfn(); | ||
328 | get_memcfg_numa(); | 327 | get_memcfg_numa(); |
329 | 328 | ||
330 | kva_pages = calculate_numa_remap_pages(); | 329 | kva_pages = calculate_numa_remap_pages(); |