summaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
authorTejun Heo2014-04-23 17:13:15 +0200
committerTejun Heo2014-04-23 17:13:15 +0200
commit3ebb2b6ef38875b866ec0118bfae7bc52afd0166 (patch)
tree79fc116b270b028a7ae4b581dd419bda81475f8e /include/linux/cgroup.h
parentcgroup: reorganize css_task_iter (diff)
downloadkernel-qcow2-linux-3ebb2b6ef38875b866ec0118bfae7bc52afd0166.tar.gz
kernel-qcow2-linux-3ebb2b6ef38875b866ec0118bfae7bc52afd0166.tar.xz
kernel-qcow2-linux-3ebb2b6ef38875b866ec0118bfae7bc52afd0166.zip
cgroup: teach css_task_iter about effective csses
Currently, css_task_iter iterates tasks associated with a css by visiting each css_set associated with the owning cgroup and walking tasks of each of them. This works fine for !unified hierarchies as each cgroup has its own css for each associated subsystem on the hierarchy; however, on the planned unified hierarchy, a cgroup may not have csses associated and its tasks would be considered associated with the matching css of the nearest ancestor which has the subsystem enabled. This means that on the default unified hierarchy, just walking all tasks associated with a cgroup isn't enough to walk all tasks which are associated with the specified css. If any of its children doesn't have the matching css enabled, task iteration should also include all tasks from the subtree. We already added cgroup->e_csets[] to list all css_sets effectively associated with a given css and walk css_sets on that list instead to achieve such iteration. This patch updates css_task_iter iteration such that it walks css_sets on cgroup->e_csets[] instead of cgroup->cset_links if iteration is requested on an non-dummy css. Thanks to the previous iteration update, this change can be achieved with the addition of css_task_iter->ss and minimal updates to css_advance_task_iter() and css_task_iter_start(). Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r--include/linux/cgroup.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index bee390586120..18fcae39e63e 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -842,6 +842,8 @@ css_next_descendant_post(struct cgroup_subsys_state *pos,
/* A css_task_iter should be treated as an opaque object */
struct css_task_iter {
+ struct cgroup_subsys *ss;
+
struct list_head *cset_pos;
struct list_head *cset_head;