From: Li Zefan Date: Wed, 31 Jul 2013 01:51:06 +0000 (+0800) Subject: cgroup: document how cgroup IDs are assigned X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b414dc09a31d41d696093a4cce9fb2853a5ecd4e;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Reviewed-by: Michal Hocko Signed-off-by: Tejun Heo --- 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 { struct cgroup { unsigned long flags; /* "unsigned long" so bitops work */ - int id; /* idr allocated in-hierarchy ID */ + /* + * idr allocated in-hierarchy ID. + * + * The ID of the root cgroup is always 0, and a new cgroup + * will be assigned with a smallest available ID. + */ + int id; /* * We link our 'sibling' struct into our parent's 'children'.