aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorVenkatesh Pallipadi <venki@google.com>2011-03-01 19:28:21 -0500
committerIngo Molnar <mingo@elte.hu>2011-03-04 05:14:31 -0500
commit6d1cafd8b56ea726c10a5a104de57cc3ed8fa953 (patch)
tree638ba81859114b2bda8b4899cf73cc20a8a31553 /kernel/sched.c
parentc02aa73b1d18e43cfd79c2f193b225e84ca497c8 (diff)
sched: Resched proper CPU on yield_to()
yield_to_task_fair() has code to resched the CPU of yielding task when the intention is to resched the CPU of the task that is being yielded to. Change here fixes the problem and also makes the resched conditional on rq != p_rq. Signed-off-by: Venkatesh Pallipadi <venki@google.com> Reviewed-by: Rik van Riel <riel@redhat.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <1299025701-22168-1-git-send-email-venki@google.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index f3030709d826..61452e86c73b 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -5522,8 +5522,15 @@ again:
5522 goto out; 5522 goto out;
5523 5523
5524 yielded = curr->sched_class->yield_to_task(rq, p, preempt); 5524 yielded = curr->sched_class->yield_to_task(rq, p, preempt);
5525 if (yielded) 5525 if (yielded) {
5526 schedstat_inc(rq, yld_count); 5526 schedstat_inc(rq, yld_count);
5527 /*
5528 * Make p's CPU reschedule; pick_next_entity takes care of
5529 * fairness.
5530 */
5531 if (preempt && rq != p_rq)
5532 resched_task(p_rq->curr);
5533 }
5527 5534
5528out: 5535out:
5529 double_rq_unlock(rq, p_rq); 5536 double_rq_unlock(rq, p_rq);