aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-05-02 08:18:52 -0400
committerTejun Heo <tj@kernel.org>2011-05-02 08:18:52 -0400
commit6bd262731bf7559bab8c749786e8652e2df1fb4e (patch)
tree64f3dccdda9175a2f2694a5d554779b8af5f035a /arch/x86/mm
parentc4b90c11992e61123071977c0e5556e59a70852c (diff)
x86, NUMA: Unify 32/64bit numa_cpu_node() implementation
Currently, the only meaningful user of apic->x86_32_numa_cpu_node() is NUMAQ which returns valid mapping only after CPU is initialized during SMP bringup; thus, the previous patch to set apicid -> node in setup_local_APIC() makes __apicid_to_node[] always contain the correct mapping whether custom apic->x86_32_numa_cpu_node() is used or not. So, there is no reason to keep separate 32bit implementation. We can always consult __apicid_to_node[]. Move 64bit implementation from numa_64.c to numa.c and remove 32bit implementation from numa_32.c. 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')
-rw-r--r--arch/x86/mm/numa.c9
-rw-r--r--arch/x86/mm/numa_32.c5
-rw-r--r--arch/x86/mm/numa_64.c9
3 files changed, 9 insertions, 14 deletions
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index 745258dfc4dc..e9005c4ea29a 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -32,6 +32,15 @@ s16 __apicid_to_node[MAX_LOCAL_APIC] __cpuinitdata = {
32 [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE 32 [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE
33}; 33};
34 34
35int __cpuinit numa_cpu_node(int cpu)
36{
37 int apicid = early_per_cpu(x86_cpu_to_apicid, cpu);
38
39 if (apicid != BAD_APICID)
40 return __apicid_to_node[apicid];
41 return NUMA_NO_NODE;
42}
43
35cpumask_var_t node_to_cpumask_map[MAX_NUMNODES]; 44cpumask_var_t node_to_cpumask_map[MAX_NUMNODES];
36EXPORT_SYMBOL(node_to_cpumask_map); 45EXPORT_SYMBOL(node_to_cpumask_map);
37 46
diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c
index c757c0a3b529..e0d9716ab382 100644
--- a/arch/x86/mm/numa_32.c
+++ b/arch/x86/mm/numa_32.c
@@ -107,11 +107,6 @@ extern unsigned long highend_pfn, highstart_pfn;
107static void *node_remap_start_vaddr[MAX_NUMNODES]; 107static void *node_remap_start_vaddr[MAX_NUMNODES];
108void set_pmd_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags); 108void set_pmd_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags);
109 109
110int __cpuinit numa_cpu_node(int cpu)
111{
112 return apic->x86_32_numa_cpu_node(cpu);
113}
114
115/* 110/*
116 * FLAT - support for basic PC memory model with discontig enabled, essentially 111 * FLAT - support for basic PC memory model with discontig enabled, essentially
117 * a single node with all available processors in it with a flat 112 * a single node with all available processors in it with a flat
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index b4fd25e753cb..7f83adec0482 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -512,15 +512,6 @@ unsigned long __init numa_free_all_bootmem(void)
512 return pages; 512 return pages;
513} 513}
514 514
515int __cpuinit numa_cpu_node(int cpu)
516{
517 int apicid = early_per_cpu(x86_cpu_to_apicid, cpu);
518
519 if (apicid != BAD_APICID)
520 return __apicid_to_node[apicid];
521 return NUMA_NO_NODE;
522}
523
524#ifdef CONFIG_MEMORY_HOTPLUG 515#ifdef CONFIG_MEMORY_HOTPLUG
525int memory_add_physaddr_to_nid(u64 start) 516int memory_add_physaddr_to_nid(u64 start)
526{ 517{