Commit 10f4dc8b authored by Ravikiran G Thirumalai's avatar Ravikiran G Thirumalai Committed by Linus Torvalds

[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.
Signed-off-by: default avatarAlok N Kataria <alokk@calsoftinc.com>
Signed-off-by: default avatarRavikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: default avatarShai Fultheim <shai@scalex86.org>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7bcd3f34
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
#include <asm/nmi.h> #include <asm/nmi.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/hw_irq.h> #include <asm/hw_irq.h>
#include <asm/numa.h>
/* Number of siblings per CPU package */ /* Number of siblings per CPU package */
int smp_num_siblings = 1; int smp_num_siblings = 1;
...@@ -890,6 +891,7 @@ do_rest: ...@@ -890,6 +891,7 @@ do_rest:
if (boot_error) { if (boot_error) {
cpu_clear(cpu, cpu_callout_map); /* was set here (do_boot_cpu()) */ cpu_clear(cpu, cpu_callout_map); /* was set here (do_boot_cpu()) */
clear_bit(cpu, &cpu_initialized); /* was set by cpu_init() */ clear_bit(cpu, &cpu_initialized); /* was set by cpu_init() */
clear_node_cpumask(cpu); /* was set by numa_add_cpu */
cpu_clear(cpu, cpu_present_map); cpu_clear(cpu, cpu_present_map);
cpu_clear(cpu, cpu_possible_map); cpu_clear(cpu, cpu_possible_map);
x86_cpu_to_apicid[cpu] = BAD_APICID; x86_cpu_to_apicid[cpu] = BAD_APICID;
...@@ -1187,6 +1189,7 @@ void remove_cpu_from_maps(void) ...@@ -1187,6 +1189,7 @@ void remove_cpu_from_maps(void)
cpu_clear(cpu, cpu_callout_map); cpu_clear(cpu, cpu_callout_map);
cpu_clear(cpu, cpu_callin_map); cpu_clear(cpu, cpu_callin_map);
clear_bit(cpu, &cpu_initialized); /* was set by cpu_init() */ clear_bit(cpu, &cpu_initialized); /* was set by cpu_init() */
clear_node_cpumask(cpu);
} }
int __cpu_disable(void) int __cpu_disable(void)
......
...@@ -22,8 +22,15 @@ extern void numa_set_node(int cpu, int node); ...@@ -22,8 +22,15 @@ extern void numa_set_node(int cpu, int node);
extern unsigned char apicid_to_node[256]; extern unsigned char apicid_to_node[256];
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
extern void __init init_cpu_to_node(void); extern void __init init_cpu_to_node(void);
static inline void clear_node_cpumask(int cpu)
{
clear_bit(cpu, &node_to_cpumask[cpu_to_node(cpu)]);
}
#else #else
#define init_cpu_to_node() do {} while (0) #define init_cpu_to_node() do {} while (0)
#define clear_node_cpumask(cpu) do {} while (0)
#endif #endif
#define NUMA_NO_NODE 0xff #define NUMA_NO_NODE 0xff
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment