aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
authorLi Zefan <lizefan@huawei.com>2013-07-30 21:51:06 -0400
committerTejun Heo <tj@kernel.org>2013-07-31 07:47:34 -0400
commitb414dc09a31d41d696093a4cce9fb2853a5ecd4e (patch)
tree63cf081d600fff0d271130b8578f17d4fb90fe49 /include/linux/cgroup.h
parent4e96ee8e981b5140a2bcc5fff0d5c0eef39a62ee (diff)
cgroup: document how cgroup IDs are assigned
As cgroup id has been used in netprio cgroup and will be used in memcg, it's important to make it clear how a cgroup id is allocated. For example, in netprio cgroup, the id is used as index of anarray. Signed-off-by: Li Zefan <lizefan@huwei.com> Reviewed-by: Michal Hocko <mhocko@suse.cz> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r--include/linux/cgroup.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index cca570e188fb..4dfcd0e1b73e 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -161,7 +161,13 @@ struct cgroup_name {
161struct cgroup { 161struct cgroup {
162 unsigned long flags; /* "unsigned long" so bitops work */ 162 unsigned long flags; /* "unsigned long" so bitops work */
163 163
164 int id; /* idr allocated in-hierarchy ID */ 164 /*
165 * idr allocated in-hierarchy ID.
166 *
167 * The ID of the root cgroup is always 0, and a new cgroup
168 * will be assigned with a smallest available ID.
169 */
170 int id;
165 171
166 /* 172 /*
167 * We link our 'sibling' struct into our parent's 'children'. 173 * We link our 'sibling' struct into our parent's 'children'.