aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2011-12-15 11:09:22 -0500
committerIngo Molnar <mingo@elte.hu>2012-03-12 15:43:15 -0400
commit5fbd036b552f633abb394a319f7c62a5c86a9cd7 (patch)
treefa91474a6aac5ea4aef0d7afc72af27c32d611af /arch/s390
parent5d6523ebd2f67de9d23285aad7f3910e7b0aee83 (diff)
sched: Cleanup cpu_active madness
Stepan found: 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. Reported-by: Stepan Moskovchenko <stepanm@codeaurora.org> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1323965362.18942.71.camel@twins Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/smp.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 2398ce6b15ae..b0e28c47ab83 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -550,12 +550,6 @@ int __cpuinit start_secondary(void *cpuvoid)
550 S390_lowcore.restart_psw.addr = 550 S390_lowcore.restart_psw.addr =
551 PSW_ADDR_AMODE | (unsigned long) psw_restart_int_handler; 551 PSW_ADDR_AMODE | (unsigned long) psw_restart_int_handler;
552 __ctl_set_bit(0, 28); /* Enable lowcore protection */ 552 __ctl_set_bit(0, 28); /* Enable lowcore protection */
553 /*
554 * Wait until the cpu which brought this one up marked it
555 * active before enabling interrupts.
556 */
557 while (!cpumask_test_cpu(smp_processor_id(), cpu_active_mask))
558 cpu_relax();
559 local_irq_enable(); 553 local_irq_enable();
560 /* cpu_idle will call schedule for us */ 554 /* cpu_idle will call schedule for us */
561 cpu_idle(); 555 cpu_idle();