From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: [PATCHSET] cgroup: implement task_cgroup_path_from_hierarchy() Date: Sun, 14 Apr 2013 11:36:55 -0700 Message-ID: <1365964619-14762-1-git-send-email-tj@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer; bh=MwTYh8sKhgL02cqGEUidwq5hbzPg1JecxAFEoK55xxA=; b=qYdg0pDIH9IRGZRVNUyDj7BSdruFkAl2Xi2ZdobMqZ6SF+iJHIb0jhWwdA2XlWTwgj eoDCKkTKaFp8D5Bx42Es3JahxN8JAFkvyNbrskzoQ8xfeVBn69giCZblGHA2sWO0vALs vgOQZYQ8SYZq72MH/Bn1TYU6tGJEzrVWCKVl9OszGJ11O7LfJ27905uIp4surpomB1Rd mNXts+aSN3TBitaWLOHXGP/PHZgN9Y9TpV2kr7Zdbv3PMoIQ8zO50gzVNbJJV/JJJGgc Ogp8/9aj2YK7/5rAcsZj8tidF0o18RutQGy0FP0xE3NZvWeb2Y21yaFREPLOvBhq2ZH5 PbCA== List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org Cc: greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, kay-tD+1rO4QERM@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, lennart-mdGvqq1h2p+GdvJs77BJ7Q@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, daniel-cYrQPVfZoowdnm+yROfE0A@public.gmane.org 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-cgroup-refactor-hierarchy_id-handling.patch 0002-cgroup-drop-hierarchy_id_lock.patch 0003-cgroup-make-hierarchy_id-use-cyclic-idr.patch 0004-cgroup-implement-task_cgroup_path_from_hierarchy.patch 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(-) -- tejun