Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87382
b: refs/heads/master
c: 0e1f348
h: refs/heads/master
v: v3
  • Loading branch information
Hiroshi Shimamoto authored and Ingo Molnar committed Mar 15, 2008
1 parent 5ef15db commit 8c73c95
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 23 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: 4faa8496650f9417189dacce8f933e8ec61dc032
refs/heads/master: 0e1f34833bd9170ccc93ab759e48e695917fa48f
38 changes: 16 additions & 22 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -4268,11 +4268,10 @@ void rt_mutex_setprio(struct task_struct *p, int prio)
oldprio = p->prio;
on_rq = p->se.on_rq;
running = task_current(rq, p);
if (on_rq) {
if (on_rq)
dequeue_task(rq, p, 0);
if (running)
p->sched_class->put_prev_task(rq, p);
}
if (running)
p->sched_class->put_prev_task(rq, p);

if (rt_prio(prio))
p->sched_class = &rt_sched_class;
Expand All @@ -4281,10 +4280,9 @@ void rt_mutex_setprio(struct task_struct *p, int prio)

p->prio = prio;

if (running)
p->sched_class->set_curr_task(rq);
if (on_rq) {
if (running)
p->sched_class->set_curr_task(rq);

enqueue_task(rq, p, 0);

check_class_changed(rq, p, prev_class, oldprio, running);
Expand Down Expand Up @@ -4581,19 +4579,17 @@ int sched_setscheduler(struct task_struct *p, int policy,
update_rq_clock(rq);
on_rq = p->se.on_rq;
running = task_current(rq, p);
if (on_rq) {
if (on_rq)
deactivate_task(rq, p, 0);
if (running)
p->sched_class->put_prev_task(rq, p);
}
if (running)
p->sched_class->put_prev_task(rq, p);

oldprio = p->prio;
__setscheduler(rq, p, policy, param->sched_priority);

if (running)
p->sched_class->set_curr_task(rq);
if (on_rq) {
if (running)
p->sched_class->set_curr_task(rq);

activate_task(rq, p, 0);

check_class_changed(rq, p, prev_class, oldprio, running);
Expand Down Expand Up @@ -7618,11 +7614,10 @@ void sched_move_task(struct task_struct *tsk)
running = task_current(rq, tsk);
on_rq = tsk->se.on_rq;

if (on_rq) {
if (on_rq)
dequeue_task(rq, tsk, 0);
if (unlikely(running))
tsk->sched_class->put_prev_task(rq, tsk);
}
if (unlikely(running))
tsk->sched_class->put_prev_task(rq, tsk);

set_task_rq(tsk, task_cpu(tsk));

Expand All @@ -7631,11 +7626,10 @@ void sched_move_task(struct task_struct *tsk)
tsk->sched_class->moved_group(tsk);
#endif

if (on_rq) {
if (unlikely(running))
tsk->sched_class->set_curr_task(rq);
if (unlikely(running))
tsk->sched_class->set_curr_task(rq);
if (on_rq)
enqueue_task(rq, tsk, 0);
}

task_rq_unlock(rq, &flags);
}
Expand Down

0 comments on commit 8c73c95

Please sign in to comment.