path: root/arch/arm/kernel/smp.c
diff options
authorVarun Wadekar <>2011-12-26 16:50:05 +0530
committerVarun Wadekar <>2011-12-26 21:28:19 -0800
commit66fa0f6523f8013b9f60af94bebbcc216f367a67 (patch)
tree350ccddfac1080d8ca9988b2b9b80c3db4672991 /arch/arm/kernel/smp.c
parent456363b8d52925d43f9255b2152935cf0d39aabe (diff)
cpu-hotplug: CPUx should be active before it is marked online
CPU0 CPUn _cpu_up() __cpu_up() boostrap() notify_cpu_starting() set_cpu_online() while (!cpu_active()) cpu_relax() <PREEMPT-out> smp_call_function(.wait=1) /* we find cpu_online() is true */ arch_send_call_function_ipi_mask() /* wait-forever-more */ <PREEMPT-in> local_irq_enable() cpu_notify(CPU_ONLINE) sched_cpu_active() set_cpu_active() Now the purpose of cpu_active is mostly with bringing down a cpu, where we mark it !active to avoid the load-balancer from moving tasks to it while we tear down the cpu. This is required because we only update the sched_domain tree after we brought the cpu-down. And this is needed so that some tasks can still run while we bring it down, we just don't want new tasks to appear. On cpu-up however the sched_domain tree doesn't yet include the new cpu, so its invisible to the load-balancer, regardless of the active state. So instead of setting the active state after we boot the new cpu (and consequently having to wait for it before enabling interrupts) set the cpu active before we set it online and avoid the whole mess. Bug 916986 Original Patch: Change-Id: Ia1c07bdc1b3eb07a7cd4d69756fa7bec509c9400 Reported-by: Stepan Moskovchenko <> Signed-off-by: Peter Zijlstra <> Signed-off-by: Varun Wadekar <> Reviewed-on: http://git-master/r/72130 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Mayuresh Kulkarni <>
Diffstat (limited to 'arch/arm/kernel/smp.c')
1 files changed, 0 insertions, 7 deletions
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index a63326923e84..d1fe8b4abbc3 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -320,13 +320,6 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
- while (!cpu_active(cpu))
- cpu_relax();
- /*
- * cpu_active bit is set, so it's safe to enable interrupts
- * now.
- */