• T
    cgroup: update iterators to use cgroup_next_sibling() · 75501a6d
    Tejun Heo 提交于
    This patch converts cgroup_for_each_child(),
    cgroup_next_descendant_pre/post() and thus
    cgroup_for_each_descendant_pre/post() to use cgroup_next_sibling()
    instead of manually dereferencing ->sibling.next.
    
    The only reason the iterators couldn't allow dropping RCU read lock
    while iteration is in progress was because they couldn't determine the
    next sibling safely once RCU read lock is dropped.  Using
    cgroup_next_sibling() removes that problem and enables all iterators
    to allow dropping RCU read lock in the middle.  Comments are updated
    accordingly.
    
    This makes the iterators easier to use and will simplify controllers.
    
    Note that @cgroup argument is renamed to @cgrp in
    cgroup_for_each_child() because it conflicts with "struct cgroup" used
    in the new macro body.
    Signed-off-by: NTejun Heo <tj@kernel.org>
    Acked-by: NSerge E. Hallyn <serge.hallyn@ubuntu.com>
    Reviewed-by: NMichal Hocko <mhocko@suse.cz>
    75501a6d
cgroup.c 147.0 KB