Messages in this thread Patch in this message | | | From | Yong Zhang <> | Subject | [PATCH 4/5] sched: refactor task_group() | Date | Sun, 20 Feb 2011 15:08:15 +0800 |
| |
move cgroup-related task group finding to cgroup_task_group(). No function change.
Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Mike Galbraith <efault@gmx.de> --- kernel/sched.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c index 18d38e4..5c74f79 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -601,7 +601,7 @@ static inline int cpu_of(struct rq *rq) * holds that lock for each task it moves into the cgroup. Therefore * by holding that lock, we pin the task to the current cgroup. */ -static inline struct task_group *task_group(struct task_struct *p) +static inline struct task_group *cgroup_task_group(struct task_struct *p) { struct task_group *tg; struct cgroup_subsys_state *css; @@ -613,6 +613,14 @@ static inline struct task_group *task_group(struct task_struct *p) lockdep_is_held(&task_rq(p)->lock)); tg = container_of(css, struct task_group, css); + return tg; +} + +static inline struct task_group *task_group(struct task_struct *p) +{ + struct task_group *tg; + + tg = cgroup_task_group(p); return autogroup_task_group(p, tg); } -- 1.7.1
| |