clean up pull_rt_task().
Signed-off-by: Ingo Molnar <mingo@elte.hu>
static int pull_rt_task(struct rq *this_rq)
{
static int pull_rt_task(struct rq *this_rq)
{
- struct task_struct *next;
- struct task_struct *p;
+ int this_cpu = this_rq->cpu, ret = 0, cpu;
+ struct task_struct *p, *next;
- int this_cpu = this_rq->cpu;
- int cpu;
- int ret = 0;
/*
* If cpusets are used, and we have overlapping
/*
* If cpusets are used, and we have overlapping
if (double_lock_balance(this_rq, src_rq)) {
/* unlocked our runqueue lock */
struct task_struct *old_next = next;
if (double_lock_balance(this_rq, src_rq)) {
/* unlocked our runqueue lock */
struct task_struct *old_next = next;
next = pick_next_task_rt(this_rq);
if (next != old_next)
ret = 1;
}
next = pick_next_task_rt(this_rq);
if (next != old_next)
ret = 1;
}
- if (likely(src_rq->rt.rt_nr_running <= 1))
+ if (likely(src_rq->rt.rt_nr_running <= 1)) {
/*
* Small chance that this_rq->curr changed
* but it's really harmless here.
*/
rt_clear_overload(this_rq);
/*
* Small chance that this_rq->curr changed
* but it's really harmless here.
*/
rt_clear_overload(this_rq);
/*
* Heh, the src_rq is now overloaded, since
* we already have the src_rq lock, go straight
* to pulling tasks from it.
*/
goto try_pulling;
/*
* Heh, the src_rq is now overloaded, since
* we already have the src_rq lock, go straight
* to pulling tasks from it.
*/
goto try_pulling;
spin_unlock(&src_rq->lock);
continue;
}
spin_unlock(&src_rq->lock);
continue;
}
*/
if (double_lock_balance(this_rq, src_rq)) {
struct task_struct *old_next = next;
*/
if (double_lock_balance(this_rq, src_rq)) {
struct task_struct *old_next = next;
next = pick_next_task_rt(this_rq);
if (next != old_next)
ret = 1;
next = pick_next_task_rt(this_rq);
if (next != old_next)
ret = 1;
*/
if (p->prio < src_rq->curr->prio ||
(next && next->prio < src_rq->curr->prio))
*/
if (p->prio < src_rq->curr->prio ||
(next && next->prio < src_rq->curr->prio))
* case there's an even higher prio task
* in another runqueue. (low likelyhood
* but possible)
* case there's an even higher prio task
* in another runqueue. (low likelyhood
* but possible)
* Update next so that we won't pick a task
* on another cpu with a priority lower (or equal)
* than the one we just picked.
* Update next so that we won't pick a task
* on another cpu with a priority lower (or equal)
* than the one we just picked.
spin_unlock(&src_rq->lock);
}
spin_unlock(&src_rq->lock);
}