Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135680
b: refs/heads/master
c: 1563513
h: refs/heads/master
v: v3
  • Loading branch information
Gregory Haskins committed Dec 29, 2008
1 parent d5790cf commit f4417ef
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 917b627d4d981dc614519d7b34ea31a976b14e12
refs/heads/master: 1563513d34ed4b12ef32bc2adde4a53ce05701a1
34 changes: 22 additions & 12 deletions trunk/kernel/sched_rt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,6 @@ static int push_rt_task(struct rq *rq)
{
struct task_struct *next_task;
struct rq *lowest_rq;
int paranoid = RT_MAX_TRIES;

if (!rq->rt.overloaded)
return 0;
Expand Down Expand Up @@ -1226,23 +1225,34 @@ static int push_rt_task(struct rq *rq)
struct task_struct *task;
/*
* find lock_lowest_rq releases rq->lock
* so it is possible that next_task has changed.
* If it has, then try again.
* so it is possible that next_task has migrated.
*
* We need to make sure that the task is still on the same
* run-queue and is also still the next task eligible for
* pushing.
*/
task = pick_next_pushable_task(rq);
if (unlikely(task != next_task) && task && paranoid--) {
put_task_struct(next_task);
next_task = task;
goto retry;
if (task_cpu(next_task) == rq->cpu && task == next_task) {
/*
* If we get here, the task hasnt moved at all, but
* it has failed to push. We will not try again,
* since the other cpus will pull from us when they
* are ready.
*/
dequeue_pushable_task(rq, next_task);
goto out;
}

if (!task)
/* No more tasks, just exit */
goto out;

/*
* Once we have failed to push this task, we will not
* try again, since the other cpus will pull from us
* when they are ready
* Something has shifted, try again.
*/
dequeue_pushable_task(rq, next_task);
goto out;
put_task_struct(next_task);
next_task = task;
goto retry;
}

deactivate_task(rq, next_task, 0);
Expand Down

0 comments on commit f4417ef

Please sign in to comment.