aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2011-12-15 17:09:22 +0100
committerDmytro Kedrovskyi <x0169235@ti.com>2012-05-16 14:13:51 +0300
commitf1773a4135c2db4c10e111ac1ce0330b2626fd7d (patch)
treefc67c06a28876c826f1b0fcc17d33fbcc3caef80 /kernel/sched.c
parentf54994fa711c9e92f8a1ef7decb52171c26e5b54 (diff)
downloadkernel_samsung_espresso10-f1773a4135c2db4c10e111ac1ce0330b2626fd7d.zip
kernel_samsung_espresso10-f1773a4135c2db4c10e111ac1ce0330b2626fd7d.tar.gz
kernel_samsung_espresso10-f1773a4135c2db4c10e111ac1ce0330b2626fd7d.tar.bz2
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. Change-Id: Ibad68784d481672eed23b0e8ad1d5fefc8755bd7 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> [taras@ti.com: backported from v3.4-rc1] Signed-off-by: Taras Kondratiuk <taras@ti.com>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 0f81bd4..6294876 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6481,7 +6481,7 @@ static int __cpuinit sched_cpu_active(struct notifier_block *nfb,
unsigned long action, void *hcpu)
{
switch (action & ~CPU_TASKS_FROZEN) {
- case CPU_ONLINE:
+ case CPU_STARTING:
case CPU_DOWN_FAILED:
set_cpu_active((long)hcpu, true);
return NOTIFY_OK;