sched: Push put_prev_task() into pick_next_task()
In order to avoid having to do put/set on a whole cgroup hierarchy when we context switch, push the put into pick_next_task() so that both operations are in the same function. Further changes then allow us to possibly optimize away redundant work. Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1328936700.2476.17.camel@laptop Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:

committed by
Ingo Molnar

parent
fed14d45f9
commit
606dba2e28
@@ -990,7 +990,7 @@ static struct sched_dl_entity *pick_next_dl_entity(struct rq *rq,
|
||||
return rb_entry(left, struct sched_dl_entity, rb_node);
|
||||
}
|
||||
|
||||
struct task_struct *pick_next_task_dl(struct rq *rq)
|
||||
struct task_struct *pick_next_task_dl(struct rq *rq, struct task_struct *prev)
|
||||
{
|
||||
struct sched_dl_entity *dl_se;
|
||||
struct task_struct *p;
|
||||
@@ -1001,6 +1001,9 @@ struct task_struct *pick_next_task_dl(struct rq *rq)
|
||||
if (unlikely(!dl_rq->dl_nr_running))
|
||||
return NULL;
|
||||
|
||||
if (prev)
|
||||
prev->sched_class->put_prev_task(rq, prev);
|
||||
|
||||
dl_se = pick_next_dl_entity(rq, dl_rq);
|
||||
BUG_ON(!dl_se);
|
||||
|
||||
|
Reference in New Issue
Block a user