diff options
author | Tejun Heo <tj@kernel.org> | 2011-02-16 06:13:06 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-02-16 06:13:06 -0500 |
commit | 86ef4dbf1f736bb1a4d567e043e3dd81b8b7860c (patch) | |
tree | 2e9663ee508b410908b3c90eb84d2161072e22d3 /arch/x86/mm | |
parent | 13081df5dd6eae1951a3c398fa17d3ed2037a78f (diff) |
x86, NUMA: Drop @start/last_pfn from initmem_init()
initmem_init() extensively accesses and modifies global data
structures and the parameters aren't even followed depending on which
path is being used. Drop @start/last_pfn and let it deal with
@max_pfn directly. This is in preparation for further NUMA init
cleanups.
- v2: x86-32 initmem_init() weren't updated breaking 32bit builds.
Fixed. Found by Yinghai.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Shaohui Zheng <shaohui.zheng@intel.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r-- | arch/x86/mm/init_32.c | 3 | ||||
-rw-r--r-- | arch/x86/mm/init_64.c | 5 | ||||
-rw-r--r-- | arch/x86/mm/numa_32.c | 3 | ||||
-rw-r--r-- | arch/x86/mm/numa_64.c | 21 |
4 files changed, 12 insertions, 20 deletions
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index c821074b7f0..16adb666560 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c | |||
@@ -644,8 +644,7 @@ void __init find_low_pfn_range(void) | |||
644 | } | 644 | } |
645 | 645 | ||
646 | #ifndef CONFIG_NEED_MULTIPLE_NODES | 646 | #ifndef CONFIG_NEED_MULTIPLE_NODES |
647 | void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn, | 647 | void __init initmem_init(int acpi, int k8) |
648 | int acpi, int k8) | ||
649 | { | 648 | { |
650 | #ifdef CONFIG_HIGHMEM | 649 | #ifdef CONFIG_HIGHMEM |
651 | highstart_pfn = highend_pfn = max_pfn; | 650 | highstart_pfn = highend_pfn = max_pfn; |
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 194f2732ab7..04cc027e543 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -603,10 +603,9 @@ kernel_physical_mapping_init(unsigned long start, | |||
603 | } | 603 | } |
604 | 604 | ||
605 | #ifndef CONFIG_NUMA | 605 | #ifndef CONFIG_NUMA |
606 | void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn, | 606 | void __init initmem_init(int acpi, int k8) |
607 | int acpi, int k8) | ||
608 | { | 607 | { |
609 | memblock_x86_register_active_regions(0, start_pfn, end_pfn); | 608 | memblock_x86_register_active_regions(0, 0, max_pfn); |
610 | init_memory_mapping_high(); | 609 | init_memory_mapping_high(); |
611 | } | 610 | } |
612 | #endif | 611 | #endif |
diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c index 505bb04654b..3249b374732 100644 --- a/arch/x86/mm/numa_32.c +++ b/arch/x86/mm/numa_32.c | |||
@@ -352,8 +352,7 @@ static void init_remap_allocator(int nid) | |||
352 | (ulong) node_remap_end_vaddr[nid]); | 352 | (ulong) node_remap_end_vaddr[nid]); |
353 | } | 353 | } |
354 | 354 | ||
355 | void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn, | 355 | void __init initmem_init(int acpi, int k8) |
356 | int acpi, int k8) | ||
357 | { | 356 | { |
358 | int nid; | 357 | int nid; |
359 | long kva_target_pfn; | 358 | long kva_target_pfn; |
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index b7d78d7a247..d7e4aafd075 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c | |||
@@ -579,8 +579,7 @@ static int __init numa_emulation(unsigned long start_pfn, | |||
579 | } | 579 | } |
580 | #endif /* CONFIG_NUMA_EMU */ | 580 | #endif /* CONFIG_NUMA_EMU */ |
581 | 581 | ||
582 | void __init initmem_init(unsigned long start_pfn, unsigned long last_pfn, | 582 | void __init initmem_init(int acpi, int amd) |
583 | int acpi, int amd) | ||
584 | { | 583 | { |
585 | int i; | 584 | int i; |
586 | 585 | ||
@@ -588,19 +587,16 @@ void __init initmem_init(unsigned long start_pfn, unsigned long last_pfn, | |||
588 | nodes_clear(node_online_map); | 587 | nodes_clear(node_online_map); |
589 | 588 | ||
590 | #ifdef CONFIG_NUMA_EMU | 589 | #ifdef CONFIG_NUMA_EMU |
591 | setup_physnodes(start_pfn << PAGE_SHIFT, last_pfn << PAGE_SHIFT, | 590 | setup_physnodes(0, max_pfn << PAGE_SHIFT, acpi, amd); |
592 | acpi, amd); | 591 | if (cmdline && !numa_emulation(0, max_pfn, acpi, amd)) |
593 | if (cmdline && !numa_emulation(start_pfn, last_pfn, acpi, amd)) | ||
594 | return; | 592 | return; |
595 | setup_physnodes(start_pfn << PAGE_SHIFT, last_pfn << PAGE_SHIFT, | 593 | setup_physnodes(0, max_pfn << PAGE_SHIFT, acpi, amd); |
596 | acpi, amd); | ||
597 | nodes_clear(node_possible_map); | 594 | nodes_clear(node_possible_map); |
598 | nodes_clear(node_online_map); | 595 | nodes_clear(node_online_map); |
599 | #endif | 596 | #endif |
600 | 597 | ||
601 | #ifdef CONFIG_ACPI_NUMA | 598 | #ifdef CONFIG_ACPI_NUMA |
602 | if (!numa_off && acpi && !acpi_scan_nodes(start_pfn << PAGE_SHIFT, | 599 | if (!numa_off && acpi && !acpi_scan_nodes(0, max_pfn << PAGE_SHIFT)) |
603 | last_pfn << PAGE_SHIFT)) | ||
604 | return; | 600 | return; |
605 | nodes_clear(node_possible_map); | 601 | nodes_clear(node_possible_map); |
606 | nodes_clear(node_online_map); | 602 | nodes_clear(node_online_map); |
@@ -616,8 +612,7 @@ void __init initmem_init(unsigned long start_pfn, unsigned long last_pfn, | |||
616 | numa_off ? "NUMA turned off" : "No NUMA configuration found"); | 612 | numa_off ? "NUMA turned off" : "No NUMA configuration found"); |
617 | 613 | ||
618 | printk(KERN_INFO "Faking a node at %016lx-%016lx\n", | 614 | printk(KERN_INFO "Faking a node at %016lx-%016lx\n", |
619 | start_pfn << PAGE_SHIFT, | 615 | 0LU, max_pfn << PAGE_SHIFT); |
620 | last_pfn << PAGE_SHIFT); | ||
621 | /* setup dummy node covering all memory */ | 616 | /* setup dummy node covering all memory */ |
622 | memnode_shift = 63; | 617 | memnode_shift = 63; |
623 | memnodemap = memnode.embedded_map; | 618 | memnodemap = memnode.embedded_map; |
@@ -626,9 +621,9 @@ void __init initmem_init(unsigned long start_pfn, unsigned long last_pfn, | |||
626 | node_set(0, node_possible_map); | 621 | node_set(0, node_possible_map); |
627 | for (i = 0; i < MAX_LOCAL_APIC; i++) | 622 | for (i = 0; i < MAX_LOCAL_APIC; i++) |
628 | set_apicid_to_node(i, NUMA_NO_NODE); | 623 | set_apicid_to_node(i, NUMA_NO_NODE); |
629 | memblock_x86_register_active_regions(0, start_pfn, last_pfn); | 624 | memblock_x86_register_active_regions(0, 0, max_pfn); |
630 | init_memory_mapping_high(); | 625 | init_memory_mapping_high(); |
631 | setup_node_bootmem(0, start_pfn << PAGE_SHIFT, last_pfn << PAGE_SHIFT); | 626 | setup_node_bootmem(0, 0, max_pfn << PAGE_SHIFT); |
632 | numa_init_array(); | 627 | numa_init_array(); |
633 | } | 628 | } |
634 | 629 | ||