Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b414dc09 authored by Li Zefan's avatar Li Zefan Committed by Tejun Heo
Browse files

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: default avatarLi Zefan <lizefan@huwei.com>
Reviewed-by: default avatarMichal Hocko <mhocko@suse.cz>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 4e96ee8e
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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'.