diff options
author | Tejun Heo <tj@kernel.org> | 2014-05-16 13:22:51 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-05-16 13:22:51 -0400 |
commit | c2931b70a32c705b9bd5762f5044f9eac8a52bb3 (patch) | |
tree | 0a530060fd1b196eda8e2ff81bd4010bd559ff12 /mm/failslab.c | |
parent | de3f034182ecbf0efbcef7ab8b253c6c3049a592 (diff) | |
download | op-kernel-dev-c2931b70a32c705b9bd5762f5044f9eac8a52bb3.zip op-kernel-dev-c2931b70a32c705b9bd5762f5044f9eac8a52bb3.tar.gz |
cgroup: iterate cgroup_subsys_states directly
Currently, css_next_child() is implemented as finding the next child
cgroup which has the css enabled, which used to be the only way to do
it as only cgroups participated in sibling lists and thus could be
iteratd. This works as long as what's required during iteration is
not missing online csses; however, it turns out that there are use
cases where offlined but not yet released csses need to be iterated.
This is difficult to implement through cgroup iteration the unified
hierarchy as there may be multiple dying csses for the same subsystem
associated with single cgroup.
After the recent changes, the cgroup self and regular csses behave
identically in how they're linked and unlinked from the sibling lists
including assertion of CSS_RELEASED and css_next_child() can simply
switch to iterating csses directly. This both simplifies the logic
and ensures that all visible non-released csses are included in the
iteration whether there are multiple dying csses for a subsystem or
not.
As all other iterators depend on css_next_child() for sibling
iteration, this changes behaviors of all css iterators. Add and
update explanations on the css states which are included in traversal
to all iterators.
As css iteration could always contain offlined csses, this shouldn't
break any of the current users and new usages which need iteration of
all on and offline csses can make use of the new semantics.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Diffstat (limited to 'mm/failslab.c')
0 files changed, 0 insertions, 0 deletions