Thread (74 messages) 74 messages, 7 authors, 2012-11-12

Re: [PATCH 3/9] cgroup: implement generic child / descendant walk macros

From: Kamezawa Hiroyuki <hidden>
Date: 2012-11-08 03:22:03
Also in: linux-pm, lkml

(2012/11/03 17:38), Tejun Heo wrote:
Currently, cgroup doesn't provide any generic helper for walking a
given cgroup's children or descendants.  This patch adds the following
three macros.

* cgroup_for_each_child() - walk immediate children of a cgroup.

* cgroup_for_each_descendant_pre() - visit all descendants of a cgroup
   in pre-order tree traversal.

* cgroup_for_each_descendant_post() - visit all descendants of a
   cgroup in post-order tree traversal.

All three only require the user to hold RCU read lock during
traversal.  Verifying that each iterated cgroup is online is the
responsibility of the user.  When used with proper synchronization,
cgroup_for_each_descendant_pre() can be used to propagate config
updates to descendants in reliable way.  See comments for details.

Signed-off-by: Tejun Heo <redacted>
maybe better than using css->id in some(many) case.

Reviewed-by: KAMEZAWA Hiroyuki <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help