aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2007-02-28 23:13:42 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-01 17:53:38 -0500
commit7355690ead6d61f6344072ae61060f985060da29 (patch)
treea8cd9d89ed0a34b6d81399eae0999a0cafa63ed8 /kernel
parent3f555c700b6c90f9ac24bc81a4f509583d906278 (diff)
[PATCH] 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: Ingo 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> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 0c5ebf59b8bc..5f102e6c7a4c 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3547,7 +3547,7 @@ need_resched_nonpreemptible:
3547 } 3547 }
3548 } 3548 }
3549 next->sleep_type = SLEEP_NORMAL; 3549 next->sleep_type = SLEEP_NORMAL;
3550 if (dependent_sleeper(cpu, rq, next)) 3550 if (rq->nr_running == 1 && dependent_sleeper(cpu, rq, next))
3551 next = rq->idle; 3551 next = rq->idle;
3552switch_tasks: 3552switch_tasks:
3553 if (next == rq->idle) 3553 if (next == rq->idle)