summaryrefslogtreecommitdiffstats
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-11-18 08:49:51 +0100
committerTejun Heo <tj@kernel.org>2014-11-18 08:49:51 +0100
commit7d172cc89b8589e4173d0c73a1ddaae408f29c9d (patch)
treeee1bb0594232895aaf2c5c6d604a2e4b8e2cbf4d /kernel/cgroup.c
parentcgroup: fix the async css offline wait logic in cgroup_subtree_control_write() (diff)
downloadlinux-7d172cc89b8589e4173d0c73a1ddaae408f29c9d.tar.xz
linux-7d172cc89b8589e4173d0c73a1ddaae408f29c9d.zip
cgroup: add cgroup_subsys->css_released()
Add a new cgroup subsys callback css_released(). This is called when the reference count of the css (cgroup_subsys_state) reaches zero before RCU scheduling free. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Zefan Li <lizefan@huawei.com>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index dffa54041d4a..c8558693102b 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4380,6 +4380,8 @@ static void css_release_work_fn(struct work_struct *work)
if (ss) {
/* css release path */
cgroup_idr_remove(&ss->css_idr, css->id);
+ if (ss->css_released)
+ ss->css_released(css);
} else {
/* cgroup release path */
cgroup_idr_remove(&cgrp->root->cgroup_idr, cgrp->id);