diff options
Diffstat (limited to 'arch/x86/mm/numa_64.c')
-rw-r--r-- | arch/x86/mm/numa_64.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index bc6dd5051d60..382377d6421d 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c | |||
@@ -31,10 +31,14 @@ bootmem_data_t plat_node_bdata[MAX_NUMNODES]; | |||
31 | 31 | ||
32 | struct memnode memnode; | 32 | struct memnode memnode; |
33 | 33 | ||
34 | u16 cpu_to_node_map[NR_CPUS] __read_mostly = { | 34 | u16 x86_cpu_to_node_map_init[NR_CPUS] __initdata = { |
35 | [0 ... NR_CPUS-1] = NUMA_NO_NODE | 35 | [0 ... NR_CPUS-1] = NUMA_NO_NODE |
36 | }; | 36 | }; |
37 | EXPORT_SYMBOL(cpu_to_node_map); | 37 | void *x86_cpu_to_node_map_early_ptr; |
38 | EXPORT_SYMBOL(x86_cpu_to_node_map_init); | ||
39 | EXPORT_SYMBOL(x86_cpu_to_node_map_early_ptr); | ||
40 | DEFINE_PER_CPU(u16, x86_cpu_to_node_map) = NUMA_NO_NODE; | ||
41 | EXPORT_PER_CPU_SYMBOL(x86_cpu_to_node_map); | ||
38 | 42 | ||
39 | u16 apicid_to_node[MAX_LOCAL_APIC] __cpuinitdata = { | 43 | u16 apicid_to_node[MAX_LOCAL_APIC] __cpuinitdata = { |
40 | [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE | 44 | [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE |
@@ -544,7 +548,7 @@ void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn) | |||
544 | node_set(0, node_possible_map); | 548 | node_set(0, node_possible_map); |
545 | for (i = 0; i < NR_CPUS; i++) | 549 | for (i = 0; i < NR_CPUS; i++) |
546 | numa_set_node(i, 0); | 550 | numa_set_node(i, 0); |
547 | /* we can't use cpumask_of_cpu() yet */ | 551 | /* cpumask_of_cpu() may not be available during early startup */ |
548 | memset(&node_to_cpumask_map[0], 0, sizeof(node_to_cpumask_map[0])); | 552 | memset(&node_to_cpumask_map[0], 0, sizeof(node_to_cpumask_map[0])); |
549 | cpu_set(0, node_to_cpumask_map[0]); | 553 | cpu_set(0, node_to_cpumask_map[0]); |
550 | e820_register_active_regions(0, start_pfn, end_pfn); | 554 | e820_register_active_regions(0, start_pfn, end_pfn); |
@@ -558,8 +562,16 @@ __cpuinit void numa_add_cpu(int cpu) | |||
558 | 562 | ||
559 | void __cpuinit numa_set_node(int cpu, int node) | 563 | void __cpuinit numa_set_node(int cpu, int node) |
560 | { | 564 | { |
565 | u16 *cpu_to_node_map = (u16 *)x86_cpu_to_node_map_early_ptr; | ||
566 | |||
561 | cpu_pda(cpu)->nodenumber = node; | 567 | cpu_pda(cpu)->nodenumber = node; |
562 | cpu_to_node_map[cpu] = node; | 568 | |
569 | if(cpu_to_node_map) | ||
570 | cpu_to_node_map[cpu] = node; | ||
571 | else if(per_cpu_offset(cpu)) | ||
572 | per_cpu(x86_cpu_to_node_map, cpu) = node; | ||
573 | else | ||
574 | Dprintk(KERN_INFO "Setting node for non-present cpu %d\n", cpu); | ||
563 | } | 575 | } |
564 | 576 | ||
565 | unsigned long __init numa_free_all_bootmem(void) | 577 | unsigned long __init numa_free_all_bootmem(void) |