diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-06-03 22:35:04 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-04 06:01:58 -0400 |
commit | 7b2a0a6c4866cac146dcb0433e6984eb19a81335 (patch) | |
tree | d498d35f1281894fddbf39dcfd5c8d848ab87bb9 /arch/x86/kernel/setup_32.c | |
parent | ee0c80fadfa56bf4f9d90c1c023429a6bd8edd69 (diff) |
x86: make 32-bit use e820_register_active_regions()
this way 32-bit is more similar to 64-bit, and smarter e820 and numa.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/setup_32.c')
-rw-r--r-- | arch/x86/kernel/setup_32.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c index ccf3595202fa..0ec6480aaa27 100644 --- a/arch/x86/kernel/setup_32.c +++ b/arch/x86/kernel/setup_32.c | |||
@@ -405,11 +405,12 @@ static void __init zone_sizes_init(void) | |||
405 | max_zone_pfns[ZONE_DMA] = | 405 | max_zone_pfns[ZONE_DMA] = |
406 | virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; | 406 | virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; |
407 | max_zone_pfns[ZONE_NORMAL] = max_low_pfn; | 407 | max_zone_pfns[ZONE_NORMAL] = max_low_pfn; |
408 | remove_all_active_ranges(); | ||
408 | #ifdef CONFIG_HIGHMEM | 409 | #ifdef CONFIG_HIGHMEM |
409 | max_zone_pfns[ZONE_HIGHMEM] = highend_pfn; | 410 | max_zone_pfns[ZONE_HIGHMEM] = highend_pfn; |
410 | add_active_range(0, 0, highend_pfn); | 411 | e820_register_active_regions(0, 0, highend_pfn); |
411 | #else | 412 | #else |
412 | add_active_range(0, 0, max_low_pfn); | 413 | e820_register_active_regions(0, 0, max_low_pfn); |
413 | #endif | 414 | #endif |
414 | 415 | ||
415 | free_area_init_nodes(max_zone_pfns); | 416 | free_area_init_nodes(max_zone_pfns); |
@@ -582,6 +583,7 @@ static void __init relocate_initrd(void) | |||
582 | 583 | ||
583 | void __init setup_bootmem_allocator(void) | 584 | void __init setup_bootmem_allocator(void) |
584 | { | 585 | { |
586 | int i; | ||
585 | unsigned long bootmap_size, bootmap; | 587 | unsigned long bootmap_size, bootmap; |
586 | /* | 588 | /* |
587 | * Initialize the boot-time allocator (with low memory only): | 589 | * Initialize the boot-time allocator (with low memory only): |
@@ -603,7 +605,8 @@ void __init setup_bootmem_allocator(void) | |||
603 | min_low_pfn<<PAGE_SHIFT, max_low_pfn<<PAGE_SHIFT); | 605 | min_low_pfn<<PAGE_SHIFT, max_low_pfn<<PAGE_SHIFT); |
604 | printk(KERN_INFO " bootmap %08lx - %08lx\n", | 606 | printk(KERN_INFO " bootmap %08lx - %08lx\n", |
605 | bootmap, bootmap + bootmap_size); | 607 | bootmap, bootmap + bootmap_size); |
606 | register_bootmem_low_pages(max_low_pfn); | 608 | for_each_online_node(i) |
609 | free_bootmem_with_active_regions(i, max_low_pfn); | ||
607 | early_res_to_bootmem(0, max_low_pfn<<PAGE_SHIFT); | 610 | early_res_to_bootmem(0, max_low_pfn<<PAGE_SHIFT); |
608 | 611 | ||
609 | #ifdef CONFIG_ACPI_SLEEP | 612 | #ifdef CONFIG_ACPI_SLEEP |
@@ -733,11 +736,20 @@ void __init setup_arch(char **cmdline_p) | |||
733 | if (efi_enabled) | 736 | if (efi_enabled) |
734 | efi_init(); | 737 | efi_init(); |
735 | 738 | ||
739 | e820_register_active_regions(0, 0, -1UL); | ||
740 | /* | ||
741 | * partially used pages are not usable - thus | ||
742 | * we are rounding upwards: | ||
743 | */ | ||
744 | max_pfn = e820_end_of_ram(); | ||
745 | |||
736 | /* update e820 for memory not covered by WB MTRRs */ | 746 | /* update e820 for memory not covered by WB MTRRs */ |
737 | find_max_pfn(); | ||
738 | mtrr_bp_init(); | 747 | mtrr_bp_init(); |
739 | if (mtrr_trim_uncached_memory(max_pfn)) | 748 | if (mtrr_trim_uncached_memory(max_pfn)) { |
740 | find_max_pfn(); | 749 | remove_all_active_ranges(); |
750 | e820_register_active_regions(0, 0, -1UL); | ||
751 | max_pfn = e820_end_of_ram(); | ||
752 | } | ||
741 | 753 | ||
742 | max_low_pfn = setup_memory(); | 754 | max_low_pfn = setup_memory(); |
743 | 755 | ||