summaryrefslogtreecommitdiff
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2015-10-15 23:41:50 +0300
committerTejun Heo <tj@kernel.org>2015-10-15 23:41:50 +0300
commitad2ed2b35b76f01a876230a3a632efbc81d3fcd6 (patch)
tree7f4f3288ba958bc8ef4f1d90cd80c31b791fe435 /kernel/cgroup.c
parent27bd4dbb8d51c476298e62bd088225317b7853de (diff)
downloadlinux-ad2ed2b35b76f01a876230a3a632efbc81d3fcd6.tar.xz
cgroup: move check_for_release() invocation
To trigger release agent when the last task leaves the cgroup, check_for_release() is called from put_css_set_locked(); however, css_set being unlinked is being decoupled from task leaving the cgroup and the correct condition to test is cgroup->nr_populated dropping to zero which check_for_release() is already updated to test. This patch moves check_for_release() invocation from put_css_set_locked() to cgroup_update_populated(). Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 435aa686567b..855313d01e85 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -623,6 +623,7 @@ static void cgroup_update_populated(struct cgroup *cgrp, bool populated)
if (!trigger)
break;
+ check_for_release(cgrp);
cgroup_file_notify(&cgrp->events_file);
cgrp = cgroup_parent(cgrp);
@@ -686,15 +687,8 @@ static void put_css_set_locked(struct css_set *cset)
css_set_count--;
list_for_each_entry_safe(link, tmp_link, &cset->cgrp_links, cgrp_link) {
- struct cgroup *cgrp = link->cgrp;
-
list_del(&link->cset_link);
list_del(&link->cgrp_link);
-
- /* @cgrp can't go away while we're holding css_set_rwsem */
- if (list_empty(&cgrp->cset_links))
- check_for_release(cgrp);
-
kfree(link);
}