[PATCHSET] cgroup: implement task_cgroup_path_from_hierarchy()

Tejun Heo tj at kernel.org
Sun Apr 14 18:36:55 UTC 2013

kdbus folks want a sane way to determine the cgroup path that a given
task belongs to on a given hierarchy, which is a reasonble thing to
expect from cgroup core.

This patchset make hierarchy_id allocation use idr instead of ida and
implement task_cgroup_path_from_hierarchy().  In the process, the
yucky ida cyclic allocation is replaced with idr_alloc_cyclic().


0001-0002 prepare for conversion to idr, which 0003 does.

0004 implements the new function.

This patchset is on top of next-20130412 as idr_alloc_cyclic() patch
is currently in -mm.  Given that this isn't an urgent thing and the
merge window is just around the corner, it'd be probably best to route
these through cgroup/for-3.11 once v3.10-rc1 drops.

These patches are also available in the following git branch.

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git review-task_cgroup_path_from_hierarchy

And it actually reduces LOC.  Woot Woot.

 include/linux/cgroup.h |    2
 kernel/cgroup.c        |  128 +++++++++++++++++++++++++++++++++----------------
 2 files changed, 89 insertions(+), 41 deletions(-)


More information about the Containers mailing list