Skip to content

Commit f3921fb

Browse files
inwardvesselhtejun
authored andcommitted
cgroup: document the rstat per-cpu initialization
The calls to css_rstat_init() occur at different places depending on the context. Document the conditions that determine which point of initialization is used. Signed-off-by: JP Kobryn <inwardvessel@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 93b3566 commit f3921fb

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

include/linux/cgroup-defs.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,21 @@ struct cgroup_subsys_state {
169169
/* reference count - access via css_[try]get() and css_put() */
170170
struct percpu_ref refcnt;
171171

172+
/*
173+
* Depending on the context, this field is initialized
174+
* via css_rstat_init() at different places:
175+
*
176+
* when css is associated with cgroup::self
177+
* when css->cgroup is the root cgroup
178+
* performed in cgroup_init()
179+
* when css->cgroup is not the root cgroup
180+
* performed in cgroup_create()
181+
* when css is associated with a subsystem
182+
* when css->cgroup is the root cgroup
183+
* performed in cgroup_init_subsys() in the non-early path
184+
* when css->cgroup is not the root cgroup
185+
* performed in css_create()
186+
*/
172187
struct css_rstat_cpu __percpu *rstat_cpu;
173188

174189
/*
@@ -530,6 +545,15 @@ struct cgroup {
530545
struct cgroup *dom_cgrp;
531546
struct cgroup *old_dom_cgrp; /* used while enabling threaded */
532547

548+
/*
549+
* Depending on the context, this field is initialized via
550+
* css_rstat_init() at different places:
551+
*
552+
* when cgroup is the root cgroup
553+
* performed in cgroup_setup_root()
554+
* otherwise
555+
* performed in cgroup_create()
556+
*/
533557
struct cgroup_rstat_base_cpu __percpu *rstat_base_cpu;
534558

535559
/*

0 commit comments

Comments
 (0)