diff options
author | Ravikiran G Thirumalai <kiran@scalex86.org> | 2006-02-07 15:58:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-07 19:12:31 -0500 |
commit | 488fc08d914f2b07b701c9b9c811437cc1c1c518 (patch) | |
tree | e84cdb61842a6b6f3286a83aad34f9e87857c32c | |
parent | 7714d5985bb7101a90fb427dc29dc592cf1b960e (diff) |
[PATCH] x86_64: Fix the node cpumask of a cpu going down
Currently, x86_64 and ia64 arches do not clear the corresponding bits in
the node's cpumask when a cpu goes down or cpu bring up is cancelled. This
is buggy since there are pieces of common code where the cpumask is checked
in the cpu down code path to decide on things (like in the slab down path).
PPC does the right thing, but x86_64 and ia64 don't (This was the reason
Sonny hit upon a slab bug during cpu offline on ppc and could not reproduce
on other arches). This patch fixes it for x86_64. I won't attempt ia64 as
I cannot test it.
Credit for spotting this should go to Alok.
(akpm: this was applied, then reverted. But it's OK now because we now use
for_each_cpu() in the right places).
Signed-off-by: Alok N Kataria <alokk@calsoftinc.com>
Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Shai Fultheim <shai@scalex86.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/x86_64/kernel/smpboot.c | 3 | ||||
-rw-r--r-- | include/asm-x86_64/numa.h | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c index a28756ef7cef..67e4e28f4df8 100644 --- a/arch/x86_64/kernel/smpboot.c +++ b/arch/x86_64/kernel/smpboot.c | |||
@@ -59,6 +59,7 @@ | |||
59 | #include <asm/nmi.h> | 59 | #include <asm/nmi.h> |
60 | #include <asm/irq.h> | 60 | #include <asm/irq.h> |
61 | #include <asm/hw_irq.h> | 61 | #include <asm/hw_irq.h> |
62 | #include <asm/numa.h> | ||
62 | 63 | ||
63 | /* Number of siblings per CPU package */ | 64 | /* Number of siblings per CPU package */ |
64 | int smp_num_siblings = 1; | 65 | int smp_num_siblings = 1; |
@@ -890,6 +891,7 @@ do_rest: | |||
890 | if (boot_error) { | 891 | if (boot_error) { |
891 | cpu_clear(cpu, cpu_callout_map); /* was set here (do_boot_cpu()) */ | 892 | cpu_clear(cpu, cpu_callout_map); /* was set here (do_boot_cpu()) */ |
892 | clear_bit(cpu, &cpu_initialized); /* was set by cpu_init() */ | 893 | clear_bit(cpu, &cpu_initialized); /* was set by cpu_init() */ |
894 | clear_node_cpumask(cpu); /* was set by numa_add_cpu */ | ||
893 | cpu_clear(cpu, cpu_present_map); | 895 | cpu_clear(cpu, cpu_present_map); |
894 | cpu_clear(cpu, cpu_possible_map); | 896 | cpu_clear(cpu, cpu_possible_map); |
895 | x86_cpu_to_apicid[cpu] = BAD_APICID; | 897 | x86_cpu_to_apicid[cpu] = BAD_APICID; |
@@ -1187,6 +1189,7 @@ void remove_cpu_from_maps(void) | |||
1187 | cpu_clear(cpu, cpu_callout_map); | 1189 | cpu_clear(cpu, cpu_callout_map); |
1188 | cpu_clear(cpu, cpu_callin_map); | 1190 | cpu_clear(cpu, cpu_callin_map); |
1189 | clear_bit(cpu, &cpu_initialized); /* was set by cpu_init() */ | 1191 | clear_bit(cpu, &cpu_initialized); /* was set by cpu_init() */ |
1192 | clear_node_cpumask(cpu); | ||
1190 | } | 1193 | } |
1191 | 1194 | ||
1192 | int __cpu_disable(void) | 1195 | int __cpu_disable(void) |
diff --git a/include/asm-x86_64/numa.h b/include/asm-x86_64/numa.h index 34e434ce3268..dffe276ca2df 100644 --- a/include/asm-x86_64/numa.h +++ b/include/asm-x86_64/numa.h | |||
@@ -22,8 +22,15 @@ extern void numa_set_node(int cpu, int node); | |||
22 | extern unsigned char apicid_to_node[256]; | 22 | extern unsigned char apicid_to_node[256]; |
23 | #ifdef CONFIG_NUMA | 23 | #ifdef CONFIG_NUMA |
24 | extern void __init init_cpu_to_node(void); | 24 | extern void __init init_cpu_to_node(void); |
25 | |||
26 | static inline void clear_node_cpumask(int cpu) | ||
27 | { | ||
28 | clear_bit(cpu, &node_to_cpumask[cpu_to_node(cpu)]); | ||
29 | } | ||
30 | |||
25 | #else | 31 | #else |
26 | #define init_cpu_to_node() do {} while (0) | 32 | #define init_cpu_to_node() do {} while (0) |
33 | #define clear_node_cpumask(cpu) do {} while (0) | ||
27 | #endif | 34 | #endif |
28 | 35 | ||
29 | #define NUMA_NO_NODE 0xff | 36 | #define NUMA_NO_NODE 0xff |