diff options
author | Peter Zijlstra <peterz@infradead.org> | 2012-02-11 00:05:00 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-02-10 10:17:13 -0500 |
commit | 606dba2e289446600a0b68422ed2019af5355c12 (patch) | |
tree | 286562f6ddcca34f3f029b68507b820f0c81b707 /kernel/sched/sched.h | |
parent | fed14d45f945042a15b09de48d7d3d58d9455fc4 (diff) |
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>
Diffstat (limited to 'kernel/sched/sched.h')
-rw-r--r-- | kernel/sched/sched.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index bb89991ee409..c534cf4181ab 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h | |||
@@ -1105,7 +1105,13 @@ struct sched_class { | |||
1105 | 1105 | ||
1106 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags); | 1106 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags); |
1107 | 1107 | ||
1108 | struct task_struct * (*pick_next_task) (struct rq *rq); | 1108 | /* |
1109 | * It is the responsibility of the pick_next_task() method that will | ||
1110 | * return the next task to call put_prev_task() on the @prev task or | ||
1111 | * something equivalent. | ||
1112 | */ | ||
1113 | struct task_struct * (*pick_next_task) (struct rq *rq, | ||
1114 | struct task_struct *prev); | ||
1109 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); | 1115 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); |
1110 | 1116 | ||
1111 | #ifdef CONFIG_SMP | 1117 | #ifdef CONFIG_SMP |