aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorHillf Danton <dhillf@gmail.com>2011-06-16 21:55:20 -0400
committerIngo Molnar <mingo@elte.hu>2011-08-14 06:00:48 -0400
commit311e800e16f63d909136a64ed17ca353a160be59 (patch)
treec5d65afd1b0abd748ad50dd15bb81434fce9a17a /kernel
parent0835471697255b415edcefd6b1e25b6c034439f2 (diff)
sched, rt: Fix rq->rt.pushable_tasks bug in push_rt_task()
Do not call dequeue_pushable_task() when failing to push an eligible task, as it remains pushable, merely not at this particular moment. Signed-off-by: Hillf Danton <dhillf@gmail.com> Signed-off-by: Mike Galbraith <mgalbraith@gmx.de> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Yong Zhang <yong.zhang0@gmail.com> Link: http://lkml.kernel.org/r/1306895385.4791.26.camel@marge.simson.net Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched_rt.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index e2698c0fc697..8e189455ed12 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -1394,6 +1394,7 @@ static int push_rt_task(struct rq *rq)
1394{ 1394{
1395 struct task_struct *next_task; 1395 struct task_struct *next_task;
1396 struct rq *lowest_rq; 1396 struct rq *lowest_rq;
1397 int ret = 0;
1397 1398
1398 if (!rq->rt.overloaded) 1399 if (!rq->rt.overloaded)
1399 return 0; 1400 return 0;
@@ -1426,7 +1427,7 @@ retry:
1426 if (!lowest_rq) { 1427 if (!lowest_rq) {
1427 struct task_struct *task; 1428 struct task_struct *task;
1428 /* 1429 /*
1429 * find lock_lowest_rq releases rq->lock 1430 * find_lock_lowest_rq releases rq->lock
1430 * so it is possible that next_task has migrated. 1431 * so it is possible that next_task has migrated.
1431 * 1432 *
1432 * We need to make sure that the task is still on the same 1433 * We need to make sure that the task is still on the same
@@ -1436,12 +1437,11 @@ retry:
1436 task = pick_next_pushable_task(rq); 1437 task = pick_next_pushable_task(rq);
1437 if (task_cpu(next_task) == rq->cpu && task == next_task) { 1438 if (task_cpu(next_task) == rq->cpu && task == next_task) {
1438 /* 1439 /*
1439 * If we get here, the task hasn't moved at all, but 1440 * The task hasn't migrated, and is still the next
1440 * it has failed to push. We will not try again, 1441 * eligible task, but we failed to find a run-queue
1441 * since the other cpus will pull from us when they 1442 * to push it to. Do not retry in this case, since
1442 * are ready. 1443 * other cpus will pull from us when ready.
1443 */ 1444 */
1444 dequeue_pushable_task(rq, next_task);
1445 goto out; 1445 goto out;
1446 } 1446 }
1447 1447
@@ -1460,6 +1460,7 @@ retry:
1460 deactivate_task(rq, next_task, 0); 1460 deactivate_task(rq, next_task, 0);
1461 set_task_cpu(next_task, lowest_rq->cpu); 1461 set_task_cpu(next_task, lowest_rq->cpu);
1462 activate_task(lowest_rq, next_task, 0); 1462 activate_task(lowest_rq, next_task, 0);
1463 ret = 1;
1463 1464
1464 resched_task(lowest_rq->curr); 1465 resched_task(lowest_rq->curr);
1465 1466
@@ -1468,7 +1469,7 @@ retry:
1468out: 1469out:
1469 put_task_struct(next_task); 1470 put_task_struct(next_task);
1470 1471
1471 return 1; 1472 return ret;
1472} 1473}
1473 1474
1474static void push_rt_tasks(struct rq *rq) 1475static void push_rt_tasks(struct rq *rq)