summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJP Kobryn <inwardvessel@gmail.com>2025-05-14 17:19:37 -0700
committerTejun Heo <tj@kernel.org>2025-05-19 10:30:02 -1000
commitf3921fb7fdc23dd946b0c082f5fedca9ce75d506 (patch)
tree9c551568a8f730c10b7854a3a2d150daa8fd2e97
parent93b35663f2018ff2accf4336a909081883eda76b (diff)
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>
-rw-r--r--include/linux/cgroup-defs.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h
index 5b8127d29dc5..e61687d5e496 100644
--- a/include/linux/cgroup-defs.h
+++ b/include/linux/cgroup-defs.h
@@ -169,6 +169,21 @@ struct cgroup_subsys_state {
/* reference count - access via css_[try]get() and css_put() */
struct percpu_ref refcnt;
+ /*
+ * Depending on the context, this field is initialized
+ * via css_rstat_init() at different places:
+ *
+ * when css is associated with cgroup::self
+ * when css->cgroup is the root cgroup
+ * performed in cgroup_init()
+ * when css->cgroup is not the root cgroup
+ * performed in cgroup_create()
+ * when css is associated with a subsystem
+ * when css->cgroup is the root cgroup
+ * performed in cgroup_init_subsys() in the non-early path
+ * when css->cgroup is not the root cgroup
+ * performed in css_create()
+ */
struct css_rstat_cpu __percpu *rstat_cpu;
/*
@@ -530,6 +545,15 @@ struct cgroup {
struct cgroup *dom_cgrp;
struct cgroup *old_dom_cgrp; /* used while enabling threaded */
+ /*
+ * Depending on the context, this field is initialized via
+ * css_rstat_init() at different places:
+ *
+ * when cgroup is the root cgroup
+ * performed in cgroup_setup_root()
+ * otherwise
+ * performed in cgroup_create()
+ */
struct cgroup_rstat_base_cpu __percpu *rstat_base_cpu;
/*