Messages in this thread Patch in this message | | | Date | Fri, 15 Jul 2011 22:42:34 +0800 | Subject | [RFC] sched: clean up RT task_woken | From | Hillf Danton <> |
| |
Hi Steven
Cleanup is made for task_woken_rt(), as the following
#1 p->rt.nr_cpus_allowed > 1 Since @rq is checked to has pushable tasks, @p is covered by the check. And if only @p is considered to be pushed, @p may be not the highest next.
#2 rt_task(rq->curr) Since curr is checked not to be rescheduled, curr must be RT task.
#3 rq->curr->rt.nr_cpus_allowed < 2 Since running task is never pushed even if pushable.
#4 rq->curr->prio < p->prio Since curr is checked not to be rescheduled.
Hillf --- kernel/sched_rt.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index 97540f0..7e6349f 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c @@ -1577,11 +1577,7 @@ static void task_woken_rt(struct rq *rq, struct task_struct *p) { if (!task_running(rq, p) && !test_tsk_need_resched(rq->curr) && - has_pushable_tasks(rq) && - p->rt.nr_cpus_allowed > 1 && - rt_task(rq->curr) && - (rq->curr->rt.nr_cpus_allowed < 2 || - rq->curr->prio < p->prio)) + has_pushable_tasks(rq)) push_rt_tasks(rq); }
| |