diff options
author | Tejun Heo <tj@kernel.org> | 2011-12-12 21:12:21 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-12-12 21:12:21 -0500 |
commit | bb9d97b6dffa10cec5e1ce9adbce60f3c2b5eabc (patch) | |
tree | fb8351518fcfb91927e9e138f48284c44553f011 /kernel/events | |
parent | 2f7ee5691eecb67c8108b92001a85563ea336ac5 (diff) |
cgroup: don't use subsys->can_attach_task() or ->attach_task()
Now that subsys->can_attach() and attach() take @tset instead of
@task, they can handle per-task operations. Convert
->can_attach_task() and ->attach_task() users to use ->can_attach()
and attach() instead. Most converions are straight-forward.
Noteworthy changes are,
* In cgroup_freezer, remove unnecessary NULL assignments to unused
methods. It's useless and very prone to get out of sync, which
already happened.
* In cpuset, PF_THREAD_BOUND test is checked for each task. This
doesn't make any practical difference but is conceptually cleaner.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Paul Menage <paul@paulmenage.org>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: James Morris <jmorris@namei.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'kernel/events')
-rw-r--r-- | kernel/events/core.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index 0e8457da6f95..3b8e0edbe693 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -7044,10 +7044,13 @@ static int __perf_cgroup_move(void *info) | |||
7044 | return 0; | 7044 | return 0; |
7045 | } | 7045 | } |
7046 | 7046 | ||
7047 | static void | 7047 | static void perf_cgroup_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, |
7048 | perf_cgroup_attach_task(struct cgroup *cgrp, struct task_struct *task) | 7048 | struct cgroup_taskset *tset) |
7049 | { | 7049 | { |
7050 | task_function_call(task, __perf_cgroup_move, task); | 7050 | struct task_struct *task; |
7051 | |||
7052 | cgroup_taskset_for_each(task, cgrp, tset) | ||
7053 | task_function_call(task, __perf_cgroup_move, task); | ||
7051 | } | 7054 | } |
7052 | 7055 | ||
7053 | static void perf_cgroup_exit(struct cgroup_subsys *ss, struct cgroup *cgrp, | 7056 | static void perf_cgroup_exit(struct cgroup_subsys *ss, struct cgroup *cgrp, |
@@ -7061,7 +7064,7 @@ static void perf_cgroup_exit(struct cgroup_subsys *ss, struct cgroup *cgrp, | |||
7061 | if (!(task->flags & PF_EXITING)) | 7064 | if (!(task->flags & PF_EXITING)) |
7062 | return; | 7065 | return; |
7063 | 7066 | ||
7064 | perf_cgroup_attach_task(cgrp, task); | 7067 | task_function_call(task, __perf_cgroup_move, task); |
7065 | } | 7068 | } |
7066 | 7069 | ||
7067 | struct cgroup_subsys perf_subsys = { | 7070 | struct cgroup_subsys perf_subsys = { |
@@ -7070,6 +7073,6 @@ struct cgroup_subsys perf_subsys = { | |||
7070 | .create = perf_cgroup_create, | 7073 | .create = perf_cgroup_create, |
7071 | .destroy = perf_cgroup_destroy, | 7074 | .destroy = perf_cgroup_destroy, |
7072 | .exit = perf_cgroup_exit, | 7075 | .exit = perf_cgroup_exit, |
7073 | .attach_task = perf_cgroup_attach_task, | 7076 | .attach = perf_cgroup_attach, |
7074 | }; | 7077 | }; |
7075 | #endif /* CONFIG_CGROUP_PERF */ | 7078 | #endif /* CONFIG_CGROUP_PERF */ |