[PATCH 4/5] sched: refactor task_group()

From: Yong Zhang
Date: Sun Feb 20 2011 - 02:08:56 EST


move cgroup-related task group finding to cgroup_task_group().
No function change.

Signed-off-by: Yong Zhang <yong.zhang0@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Mike Galbraith <efault@xxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/