diff options
author | Tejun Heo <tj@kernel.org> | 2011-01-23 08:37:41 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-01-28 08:54:10 -0500 |
commit | de2d9445f1627830ed2ebd00ee9d851986c940b5 (patch) | |
tree | f71c90737aefaca45d0e28b904c59660809ea0b3 /arch/x86/include | |
parent | 645a79195f66eb68ef3ab2b21d9829ac3aa085a9 (diff) |
x86: Unify node_to_cpumask_map handling between 32 and 64bit
x86_32 has been managing node_to_cpumask_map explicitly from
map_cpu_to_node() and friends in a rather ugly way. With
previous changes, it's now possible to share the code with
64bit.
* When CONFIG_NUMA_EMU is disabled, numa_add/remove_cpu() are
implemented in numa.c and shared by 32 and 64bit. CONFIG_NUMA_EMU
versions still live in numa_64.c.
NUMA_EMU's dependency on 64bit is planned to be removed and the
above should go away together.
* identify_cpu() now calls numa_add_cpu() for 32bit too. This
makes the explicit mask management from map_cpu_to_node() unnecessary.
* The whole x86_32 specific map_cpu_to_node() chunk is no longer
necessary. Dropped.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
Cc: eric.dumazet@gmail.com
Cc: yinghai@kernel.org
Cc: brgerst@gmail.com
Cc: gorcunov@gmail.com
Cc: shaohui.zheng@intel.com
Cc: rientjes@google.com
LKML-Reference: <1295789862-25482-16-git-send-email-tj@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: David Rientjes <rientjes@google.com>
Cc: Shaohui Zheng <shaohui.zheng@intel.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/numa.h | 9 | ||||
-rw-r--r-- | arch/x86/include/asm/numa_32.h | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/numa_64.h | 4 |
3 files changed, 9 insertions, 5 deletions
diff --git a/arch/x86/include/asm/numa.h b/arch/x86/include/asm/numa.h index 2b21fff9f655..d3964b28b128 100644 --- a/arch/x86/include/asm/numa.h +++ b/arch/x86/include/asm/numa.h | |||
@@ -1,6 +1,7 @@ | |||
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 <asm/topology.h> | ||
4 | #include <asm/apicdef.h> | 5 | #include <asm/apicdef.h> |
5 | 6 | ||
6 | #ifdef CONFIG_NUMA | 7 | #ifdef CONFIG_NUMA |
@@ -33,9 +34,17 @@ static inline void set_apicid_to_node(int apicid, s16 node) | |||
33 | #ifdef CONFIG_NUMA | 34 | #ifdef CONFIG_NUMA |
34 | extern void __cpuinit numa_set_node(int cpu, int node); | 35 | extern void __cpuinit numa_set_node(int cpu, int node); |
35 | extern void __cpuinit numa_clear_node(int cpu); | 36 | extern void __cpuinit numa_clear_node(int cpu); |
37 | extern void __cpuinit numa_add_cpu(int cpu); | ||
38 | extern void __cpuinit numa_remove_cpu(int cpu); | ||
36 | #else /* CONFIG_NUMA */ | 39 | #else /* CONFIG_NUMA */ |
37 | static inline void numa_set_node(int cpu, int node) { } | 40 | static inline void numa_set_node(int cpu, int node) { } |
38 | static inline void numa_clear_node(int cpu) { } | 41 | static inline void numa_clear_node(int cpu) { } |
42 | static inline void numa_add_cpu(int cpu) { } | ||
43 | static inline void numa_remove_cpu(int cpu) { } | ||
39 | #endif /* CONFIG_NUMA */ | 44 | #endif /* CONFIG_NUMA */ |
40 | 45 | ||
46 | #ifdef CONFIG_DEBUG_PER_CPU_MAPS | ||
47 | struct cpumask __cpuinit *debug_cpumask_set_cpu(int cpu, int enable); | ||
48 | #endif | ||
49 | |||
41 | #endif /* _ASM_X86_NUMA_H */ | 50 | #endif /* _ASM_X86_NUMA_H */ |
diff --git a/arch/x86/include/asm/numa_32.h b/arch/x86/include/asm/numa_32.h index cdf8043d7a1a..bc66031afa1f 100644 --- a/arch/x86/include/asm/numa_32.h +++ b/arch/x86/include/asm/numa_32.h | |||
@@ -4,7 +4,6 @@ | |||
4 | extern int numa_off; | 4 | extern int numa_off; |
5 | 5 | ||
6 | extern int pxm_to_nid(int pxm); | 6 | extern int pxm_to_nid(int pxm); |
7 | extern void numa_remove_cpu(int cpu); | ||
8 | 7 | ||
9 | #ifdef CONFIG_NUMA | 8 | #ifdef CONFIG_NUMA |
10 | extern int __cpuinit numa_cpu_node(int apicid); | 9 | extern int __cpuinit numa_cpu_node(int apicid); |
diff --git a/arch/x86/include/asm/numa_64.h b/arch/x86/include/asm/numa_64.h index 6ead9f361bda..123f1856101c 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_add_cpu(int cpu); | ||
34 | extern void __cpuinit numa_remove_cpu(int cpu); | ||
35 | 33 | ||
36 | #ifdef CONFIG_NUMA_EMU | 34 | #ifdef CONFIG_NUMA_EMU |
37 | #define FAKE_NODE_MIN_SIZE ((u64)32 << 20) | 35 | #define FAKE_NODE_MIN_SIZE ((u64)32 << 20) |
@@ -41,8 +39,6 @@ void numa_emu_cmdline(char *); | |||
41 | #else | 39 | #else |
42 | static inline void init_cpu_to_node(void) { } | 40 | static inline void init_cpu_to_node(void) { } |
43 | static inline int numa_cpu_node(int cpu) { return NUMA_NO_NODE; } | 41 | static inline int numa_cpu_node(int cpu) { return NUMA_NO_NODE; } |
44 | static inline void numa_add_cpu(int cpu, int node) { } | ||
45 | static inline void numa_remove_cpu(int cpu) { } | ||
46 | #endif | 42 | #endif |
47 | 43 | ||
48 | #endif /* _ASM_X86_NUMA_64_H */ | 44 | #endif /* _ASM_X86_NUMA_64_H */ |