Commit d499ac7a authored by Ingo Molnar's avatar Ingo Molnar Committed by Greg Kroah-Hartman

sched: fix SMT scheduler bug

The SMT scheduler incorrectly skips kernel threads even if they are
runnable (but they are preempted by a higher-prio user-space task which got
SMT-delayed by an even higher-priority task running on a sibling CPU).

Fix this for now by only doing the SMT-nice optimization if the
to-be-delayed task is the only runnable task.  (This should cover most of
the real-life cases anyway.)

This bug has been in the SMT scheduler since 2.6.17 or so, but has only
been noticed now by the active check in the dynticks code.
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 530b0916
...@@ -3528,7 +3528,7 @@ asmlinkage void __sched schedule(void) ...@@ -3528,7 +3528,7 @@ asmlinkage void __sched schedule(void)
} }
} }
next->sleep_type = SLEEP_NORMAL; next->sleep_type = SLEEP_NORMAL;
if (dependent_sleeper(cpu, rq, next)) if (rq->nr_running == 1 && dependent_sleeper(cpu, rq, next))
next = rq->idle; next = rq->idle;
switch_tasks: switch_tasks:
if (next == rq->idle) if (next == rq->idle)
......
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