]> git.karo-electronics.de Git - linux-beck.git/commit
sched: Fix idle_cpu()
authorThomas Gleixner <tglx@linutronix.de>
Thu, 15 Sep 2011 13:32:06 +0000 (15:32 +0200)
committerIngo Molnar <mingo@elte.hu>
Tue, 4 Oct 2011 10:44:07 +0000 (12:44 +0200)
commit908a3283728d92df36e0c7cd63304fd35e93a8a9
tree2511eb8eee1ebc534f34abd640e0fddb4d4fe5a3
parentf0f1d32f931b705c4ee5dd374074d34edf3eae14
sched: Fix idle_cpu()

On -rt we observed hackbench waking all 400 tasks to a single cpu.
This is because of select_idle_sibling()'s interaction with the new
ipi based wakeup scheme.

The existing idle_cpu() test only checks to see if the current task on
that cpu is the idle task, it does not take already queued tasks into
account, nor does it take queued to be woken tasks into account.

If the remote wakeup IPIs come hard enough, there won't be time to
schedule away from the idle task, and would thus keep thinking the cpu
was in fact idle, regardless of the fact that there were already
several hundred tasks runnable.

We couldn't reproduce on mainline, but there's no reason it couldn't
happen.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-3o30p18b2paswpc9ohy2gltp@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched.c