diff options
author | Tejun Heo <tj@kernel.org> | 2011-01-23 08:37:40 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-01-28 08:54:09 -0500 |
commit | 645a79195f66eb68ef3ab2b21d9829ac3aa085a9 (patch) | |
tree | 5808c94ad0371f70a391e1e77baf12465969e19c /arch/x86/include | |
parent | bbc9e2f452d9c4b166d1f9a78d941d80173312fe (diff) |
x86: Unify CPU -> NUMA node mapping between 32 and 64bit
Unlike 64bit, 32bit has been using its own cpu_to_node_map[] for
CPU -> NUMA node mapping. Replace it with early_percpu variable
x86_cpu_to_node_map and share the mapping code with 64bit.
* USE_PERCPU_NUMA_NODE_ID is now enabled for 32bit too.
* x86_cpu_to_node_map and numa_set/clear_node() are moved from
numa_64 to numa. For now, on 32bit, x86_cpu_to_node_map is initialized
with 0 instead of NUMA_NO_NODE. This is to avoid introducing unexpected
behavior change and will be updated once init path is unified.
* srat_detect_node() is now enabled for x86_32 too. It calls
numa_set_node() and initializes the mapping making explicit
cpu_to_node_map[] updates from map/unmap_cpu_to_node() unnecessary.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: eric.dumazet@gmail.com
Cc: yinghai@kernel.org
Cc: brgerst@gmail.com
Cc: gorcunov@gmail.com
Cc: penberg@kernel.org
Cc: shaohui.zheng@intel.com
Cc: rientjes@google.com
LKML-Reference: <1295789862-25482-15-git-send-email-tj@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: David Rientjes <rientjes@google.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/numa.h | 8 | ||||
-rw-r--r-- | arch/x86/include/asm/numa_64.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/topology.h | 17 |
3 files changed, 8 insertions, 21 deletions
diff --git a/arch/x86/include/asm/numa.h b/arch/x86/include/asm/numa.h index 5e01c768a57..2b21fff9f65 100644 --- a/arch/x86/include/asm/numa.h +++ b/arch/x86/include/asm/numa.h | |||
@@ -30,4 +30,12 @@ static inline void set_apicid_to_node(int apicid, s16 node) | |||
30 | # include "numa_64.h" | 30 | # include "numa_64.h" |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | #ifdef CONFIG_NUMA | ||
34 | extern void __cpuinit numa_set_node(int cpu, int node); | ||
35 | extern void __cpuinit numa_clear_node(int cpu); | ||
36 | #else /* CONFIG_NUMA */ | ||
37 | static inline void numa_set_node(int cpu, int node) { } | ||
38 | static inline void numa_clear_node(int cpu) { } | ||
39 | #endif /* CONFIG_NUMA */ | ||
40 | |||
33 | #endif /* _ASM_X86_NUMA_H */ | 41 | #endif /* _ASM_X86_NUMA_H */ |
diff --git a/arch/x86/include/asm/numa_64.h b/arch/x86/include/asm/numa_64.h index 4982a9c08c2..6ead9f361bd 100644 --- a/arch/x86/include/asm/numa_64.h +++ b/arch/x86/include/asm/numa_64.h | |||
@@ -30,8 +30,6 @@ extern void setup_node_bootmem(int nodeid, unsigned long start, | |||
30 | 30 | ||
31 | extern void __init init_cpu_to_node(void); | 31 | extern void __init init_cpu_to_node(void); |
32 | extern int __cpuinit numa_cpu_node(int cpu); | 32 | extern int __cpuinit numa_cpu_node(int cpu); |
33 | extern void __cpuinit numa_set_node(int cpu, int node); | ||
34 | extern void __cpuinit numa_clear_node(int cpu); | ||
35 | extern void __cpuinit numa_add_cpu(int cpu); | 33 | extern void __cpuinit numa_add_cpu(int cpu); |
36 | extern void __cpuinit numa_remove_cpu(int cpu); | 34 | extern void __cpuinit numa_remove_cpu(int cpu); |
37 | 35 | ||
@@ -43,8 +41,6 @@ void numa_emu_cmdline(char *); | |||
43 | #else | 41 | #else |
44 | static inline void init_cpu_to_node(void) { } | 42 | static inline void init_cpu_to_node(void) { } |
45 | static inline int numa_cpu_node(int cpu) { return NUMA_NO_NODE; } | 43 | static inline int numa_cpu_node(int cpu) { return NUMA_NO_NODE; } |
46 | static inline void numa_set_node(int cpu, int node) { } | ||
47 | static inline void numa_clear_node(int cpu) { } | ||
48 | static inline void numa_add_cpu(int cpu, int node) { } | 44 | static inline void numa_add_cpu(int cpu, int node) { } |
49 | static inline void numa_remove_cpu(int cpu) { } | 45 | static inline void numa_remove_cpu(int cpu) { } |
50 | #endif | 46 | #endif |
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index 21899cc31e5..b101c17861f 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h | |||
@@ -47,21 +47,6 @@ | |||
47 | 47 | ||
48 | #include <asm/mpspec.h> | 48 | #include <asm/mpspec.h> |
49 | 49 | ||
50 | #ifdef CONFIG_X86_32 | ||
51 | |||
52 | /* Mappings between logical cpu number and node number */ | ||
53 | extern int cpu_to_node_map[]; | ||
54 | |||
55 | /* Returns the number of the node containing CPU 'cpu' */ | ||
56 | static inline int __cpu_to_node(int cpu) | ||
57 | { | ||
58 | return cpu_to_node_map[cpu]; | ||
59 | } | ||
60 | #define early_cpu_to_node __cpu_to_node | ||
61 | #define cpu_to_node __cpu_to_node | ||
62 | |||
63 | #else /* CONFIG_X86_64 */ | ||
64 | |||
65 | /* Mappings between logical cpu number and node number */ | 50 | /* Mappings between logical cpu number and node number */ |
66 | DECLARE_EARLY_PER_CPU(int, x86_cpu_to_node_map); | 51 | DECLARE_EARLY_PER_CPU(int, x86_cpu_to_node_map); |
67 | 52 | ||
@@ -84,8 +69,6 @@ static inline int early_cpu_to_node(int cpu) | |||
84 | 69 | ||
85 | #endif /* !CONFIG_DEBUG_PER_CPU_MAPS */ | 70 | #endif /* !CONFIG_DEBUG_PER_CPU_MAPS */ |
86 | 71 | ||
87 | #endif /* CONFIG_X86_64 */ | ||
88 | |||
89 | /* Mappings between node number and cpus on that node. */ | 72 | /* Mappings between node number and cpus on that node. */ |
90 | extern cpumask_var_t node_to_cpumask_map[MAX_NUMNODES]; | 73 | extern cpumask_var_t node_to_cpumask_map[MAX_NUMNODES]; |
91 | 74 | ||