diff options
| author | Tejun Heo <tj@kernel.org> | 2011-05-02 11:24:48 -0400 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2011-05-02 11:24:48 -0400 |
| commit | bd6709a91a593d8fe35d08da542e9f93bb74a304 (patch) | |
| tree | a7e24844eaee2113bfb61e6fa6d990c01ed5ec64 /arch/x86/mm/numa.c | |
| parent | 7888e96b264fad27f97f58c0f3a4d20326eaf181 (diff) | |
x86, NUMA: Make 32bit use common NUMA init path
With both _numa_init() methods converted and the rest of init code
adjusted, numa_32.c now can switch from the 32bit only init code to
the common one in numa.c.
* Shim get_memcfg_*()'s are dropped and initmem_init() calls
x86_numa_init(), which is updated to handle NUMAQ.
* All boilerplate operations including node range limiting, pgdat
alloc/init are handled by numa_init(). 32bit only implementation is
removed.
* 32bit numa_add_memblk(), numa_set_distance() and
memory_add_physaddr_to_nid() removed and common versions in
numa_32.c enabled for 32bit.
This change causes the following behavior changes.
* NODE_DATA()->node_start_pfn/node_spanned_pages properly initialized
for 32bit too.
* Much more sanity checks and configuration cleanups.
* Proper handling of node distances.
* The same NUMA init messages as 64bit.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Diffstat (limited to 'arch/x86/mm/numa.c')
| -rw-r--r-- | arch/x86/mm/numa.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index a72317ae74c5..56ed714ed24f 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c | |||
| @@ -173,7 +173,6 @@ void __init numa_remove_memblk_from(int idx, struct numa_meminfo *mi) | |||
| 173 | (mi->nr_blks - idx) * sizeof(mi->blk[0])); | 173 | (mi->nr_blks - idx) * sizeof(mi->blk[0])); |
| 174 | } | 174 | } |
| 175 | 175 | ||
| 176 | #ifdef CONFIG_X86_64 | ||
| 177 | /** | 176 | /** |
| 178 | * numa_add_memblk - Add one numa_memblk to numa_meminfo | 177 | * numa_add_memblk - Add one numa_memblk to numa_meminfo |
| 179 | * @nid: NUMA node ID of the new memblk | 178 | * @nid: NUMA node ID of the new memblk |
| @@ -189,7 +188,6 @@ int __init numa_add_memblk(int nid, u64 start, u64 end) | |||
| 189 | { | 188 | { |
| 190 | return numa_add_memblk_to(nid, start, end, &numa_meminfo); | 189 | return numa_add_memblk_to(nid, start, end, &numa_meminfo); |
| 191 | } | 190 | } |
| 192 | #endif | ||
| 193 | 191 | ||
| 194 | /* Initialize bootmem allocator for a node */ | 192 | /* Initialize bootmem allocator for a node */ |
| 195 | static void __init setup_node_bootmem(int nid, u64 start, u64 end) | 193 | static void __init setup_node_bootmem(int nid, u64 start, u64 end) |
| @@ -413,7 +411,6 @@ static int __init numa_alloc_distance(void) | |||
| 413 | return 0; | 411 | return 0; |
| 414 | } | 412 | } |
| 415 | 413 | ||
| 416 | #ifdef CONFIG_X86_64 | ||
| 417 | /** | 414 | /** |
| 418 | * numa_set_distance - Set NUMA distance from one NUMA to another | 415 | * numa_set_distance - Set NUMA distance from one NUMA to another |
| 419 | * @from: the 'from' node to set distance | 416 | * @from: the 'from' node to set distance |
| @@ -452,7 +449,6 @@ void __init numa_set_distance(int from, int to, int distance) | |||
| 452 | 449 | ||
| 453 | numa_distance[from * numa_distance_cnt + to] = distance; | 450 | numa_distance[from * numa_distance_cnt + to] = distance; |
| 454 | } | 451 | } |
| 455 | #endif | ||
| 456 | 452 | ||
| 457 | int __node_distance(int from, int to) | 453 | int __node_distance(int from, int to) |
| 458 | { | 454 | { |
| @@ -626,6 +622,10 @@ static int __init dummy_numa_init(void) | |||
| 626 | void __init x86_numa_init(void) | 622 | void __init x86_numa_init(void) |
| 627 | { | 623 | { |
| 628 | if (!numa_off) { | 624 | if (!numa_off) { |
| 625 | #ifdef CONFIG_X86_NUMAQ | ||
| 626 | if (!numa_init(numaq_numa_init)) | ||
| 627 | return; | ||
| 628 | #endif | ||
| 629 | #ifdef CONFIG_ACPI_NUMA | 629 | #ifdef CONFIG_ACPI_NUMA |
| 630 | if (!numa_init(x86_acpi_numa_init)) | 630 | if (!numa_init(x86_acpi_numa_init)) |
| 631 | return; | 631 | return; |
| @@ -805,7 +805,7 @@ EXPORT_SYMBOL(cpumask_of_node); | |||
| 805 | 805 | ||
| 806 | #endif /* !CONFIG_DEBUG_PER_CPU_MAPS */ | 806 | #endif /* !CONFIG_DEBUG_PER_CPU_MAPS */ |
| 807 | 807 | ||
| 808 | #if defined(CONFIG_X86_64) && defined(CONFIG_MEMORY_HOTPLUG) | 808 | #ifdef CONFIG_MEMORY_HOTPLUG |
| 809 | int memory_add_physaddr_to_nid(u64 start) | 809 | int memory_add_physaddr_to_nid(u64 start) |
| 810 | { | 810 | { |
| 811 | struct numa_meminfo *mi = &numa_meminfo; | 811 | struct numa_meminfo *mi = &numa_meminfo; |
