aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-02-12 09:29:50 -0500
committerTejun Heo <tj@kernel.org>2014-02-12 09:29:50 -0500
commit776f02fa4e1ad70557c0318c70ce928e0642bee0 (patch)
treef2080066461b0ef75a964a8ef2b9a2243d7b5389 /include/linux/cgroup.h
parent3c9c825b8b50de7dbb015e6bfc04bb2da79364d9 (diff)
cgroup: remove cgroupfs_root->refcnt
Currently, cgroupfs_root and its ->top_cgroup are separated reference counted and the latter's is ignored. There's no reason to do this separately. This patch removes cgroupfs_root->refcnt and destroys cgroupfs_root when the top_cgroup is released. * cgroup_put() updated to ignore cgroup_is_dead() test for top cgroups. cgroup_free_fn() updated to handle root destruction when releasing a top cgroup. * As root destruction is now bounced through cgroup destruction, it is asynchronous. Update cgroup_mount() so that it waits for pending release which is currently implemented using msleep(). Converting this to proper wait_queue isn't hard but likely unnecessary. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r--include/linux/cgroup.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index f0e6105bbbc1..298d616e8f40 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -282,12 +282,10 @@ struct cgroupfs_root {
282 /* The bitmask of subsystems attached to this hierarchy */ 282 /* The bitmask of subsystems attached to this hierarchy */
283 unsigned long subsys_mask; 283 unsigned long subsys_mask;
284 284
285 atomic_t refcnt;
286
287 /* Unique id for this hierarchy. */ 285 /* Unique id for this hierarchy. */
288 int hierarchy_id; 286 int hierarchy_id;
289 287
290 /* The root cgroup for this hierarchy */ 288 /* The root cgroup. Root is destroyed on its release. */
291 struct cgroup top_cgroup; 289 struct cgroup top_cgroup;
292 290
293 /* Number of cgroups in the hierarchy, used only for /proc/cgroups */ 291 /* Number of cgroups in the hierarchy, used only for /proc/cgroups */