aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/numa.h10
-rw-r--r--arch/x86/include/asm/numa_32.h6
-rw-r--r--arch/x86/include/asm/numa_64.h3
-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
6 files changed, 19 insertions, 23 deletions
diff --git a/arch/x86/include/asm/numa.h b/arch/x86/include/asm/numa.h
index a50fc9f493b3..5982d418c358 100644
--- a/arch/x86/include/asm/numa.h
+++ b/arch/x86/include/asm/numa.h
@@ -1,6 +1,8 @@
1#ifndef _ASM_X86_NUMA_H 1#ifndef _ASM_X86_NUMA_H
2#define _ASM_X86_NUMA_H 2#define _ASM_X86_NUMA_H
3 3
4#include <linux/nodemask.h>
5
4#include <asm/topology.h> 6#include <asm/topology.h>
5#include <asm/apicdef.h> 7#include <asm/apicdef.h>
6 8
@@ -22,10 +24,18 @@ static inline void set_apicid_to_node(int apicid, s16 node)
22{ 24{
23 __apicid_to_node[apicid] = node; 25 __apicid_to_node[apicid] = node;
24} 26}
27
28extern int __cpuinit numa_cpu_node(int cpu);
29
25#else /* CONFIG_NUMA */ 30#else /* CONFIG_NUMA */
26static inline void set_apicid_to_node(int apicid, s16 node) 31static inline void set_apicid_to_node(int apicid, s16 node)
27{ 32{
28} 33}
34
35static inline int numa_cpu_node(int cpu)
36{
37 return NUMA_NO_NODE;
38}
29#endif /* CONFIG_NUMA */ 39#endif /* CONFIG_NUMA */
30 40
31#ifdef CONFIG_X86_32 41#ifdef CONFIG_X86_32
diff --git a/arch/x86/include/asm/numa_32.h b/arch/x86/include/asm/numa_32.h
index c6beed1ef103..242522fe9f8d 100644
--- a/arch/x86/include/asm/numa_32.h
+++ b/arch/x86/include/asm/numa_32.h
@@ -5,12 +5,6 @@ extern int numa_off;
5 5
6extern int pxm_to_nid(int pxm); 6extern int pxm_to_nid(int pxm);
7 7
8#ifdef CONFIG_NUMA
9extern int __cpuinit numa_cpu_node(int cpu);
10#else /* CONFIG_NUMA */
11static inline int numa_cpu_node(int cpu) { return NUMA_NO_NODE; }
12#endif /* CONFIG_NUMA */
13
14#ifdef CONFIG_HIGHMEM 8#ifdef CONFIG_HIGHMEM
15extern void set_highmem_pages_init(void); 9extern void set_highmem_pages_init(void);
16#else 10#else
diff --git a/arch/x86/include/asm/numa_64.h b/arch/x86/include/asm/numa_64.h
index 344eb1790b46..12461ebec704 100644
--- a/arch/x86/include/asm/numa_64.h
+++ b/arch/x86/include/asm/numa_64.h
@@ -26,7 +26,6 @@ extern void setup_node_bootmem(int nodeid, unsigned long start,
26 26
27extern nodemask_t numa_nodes_parsed __initdata; 27extern nodemask_t numa_nodes_parsed __initdata;
28 28
29extern int __cpuinit numa_cpu_node(int cpu);
30extern int __init numa_add_memblk(int nodeid, u64 start, u64 end); 29extern int __init numa_add_memblk(int nodeid, u64 start, u64 end);
31extern void __init numa_set_distance(int from, int to, int distance); 30extern void __init numa_set_distance(int from, int to, int distance);
32 31
@@ -35,8 +34,6 @@ extern void __init numa_set_distance(int from, int to, int distance);
35#define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL)) 34#define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL))
36void numa_emu_cmdline(char *); 35void numa_emu_cmdline(char *);
37#endif /* CONFIG_NUMA_EMU */ 36#endif /* CONFIG_NUMA_EMU */
38#else
39static inline int numa_cpu_node(int cpu) { return NUMA_NO_NODE; }
40#endif 37#endif
41 38
42#endif /* _ASM_X86_NUMA_64_H */ 39#endif /* _ASM_X86_NUMA_64_H */
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{