aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-08-08 20:11:26 -0400
committerTejun Heo <tj@kernel.org>2013-08-08 20:11:26 -0400
commit72ec7029937f0518eff21b8762743c31591684f5 (patch)
tree43743a5d9e6a36548a23d5ff34ffc4c4fede8aa1 /include/linux/cgroup.h
parente535837b1dae17b5a2d76ea1bc22ac1a79354624 (diff)
cgroup: make task iterators deal with cgroup_subsys_state instead of cgroup
cgroup is in the process of converting to css (cgroup_subsys_state) from cgroup as the principal subsystem interface handle. This is mostly to prepare for the unified hierarchy support where css's will be created and destroyed dynamically but also helps cleaning up subsystem implementations as css is usually what they are interested in anyway. This patch converts task iterators to deal with css instead of cgroup. Note that under unified hierarchy, different sets of tasks will be considered belonging to a given cgroup depending on the subsystem in question and making the iterators deal with css instead cgroup provides them with enough information about the iteration. While at it, fix several function comment formats in cpuset.c. This patch doesn't introduce any behavior differences. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com> Acked-by: Michal Hocko <mhocko@suse.cz> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Balbir Singh <bsingharora@gmail.com> Cc: Matt Helsley <matthltc@us.ibm.com>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r--include/linux/cgroup.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 8472ed576b64..cd105fce089c 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -880,21 +880,22 @@ css_next_descendant_post(struct cgroup_subsys_state *pos,
880 for ((pos) = css_next_descendant_post(NULL, (css)); (pos); \ 880 for ((pos) = css_next_descendant_post(NULL, (css)); (pos); \
881 (pos) = css_next_descendant_post((pos), (css))) 881 (pos) = css_next_descendant_post((pos), (css)))
882 882
883/* A cgroup_task_iter should be treated as an opaque object */ 883/* A css_task_iter should be treated as an opaque object */
884struct cgroup_task_iter { 884struct css_task_iter {
885 struct cgroup *origin_cgrp; 885 struct cgroup_subsys_state *origin_css;
886 struct list_head *cset_link; 886 struct list_head *cset_link;
887 struct list_head *task; 887 struct list_head *task;
888}; 888};
889 889
890void cgroup_task_iter_start(struct cgroup *cgrp, struct cgroup_task_iter *it); 890void css_task_iter_start(struct cgroup_subsys_state *css,
891struct task_struct *cgroup_task_iter_next(struct cgroup_task_iter *it); 891 struct css_task_iter *it);
892void cgroup_task_iter_end(struct cgroup_task_iter *it); 892struct task_struct *css_task_iter_next(struct css_task_iter *it);
893void css_task_iter_end(struct css_task_iter *it);
893 894
894int cgroup_scan_tasks(struct cgroup *cgrp, 895int css_scan_tasks(struct cgroup_subsys_state *css,
895 bool (*test)(struct task_struct *, void *), 896 bool (*test)(struct task_struct *, void *),
896 void (*process)(struct task_struct *, void *), 897 void (*process)(struct task_struct *, void *),
897 void *data, struct ptr_heap *heap); 898 void *data, struct ptr_heap *heap);
898 899
899int cgroup_attach_task_all(struct task_struct *from, struct task_struct *); 900int cgroup_attach_task_all(struct task_struct *from, struct task_struct *);
900int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from); 901int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from);