diff options
author | Tejun Heo <tj@kernel.org> | 2015-10-15 16:41:50 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2015-10-15 16:41:50 -0400 |
commit | ad2ed2b35b76f01a876230a3a632efbc81d3fcd6 (patch) | |
tree | 7f4f3288ba958bc8ef4f1d90cd80c31b791fe435 | |
parent | 27bd4dbb8d51c476298e62bd088225317b7853de (diff) |
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>
-rw-r--r-- | kernel/cgroup.c | 8 |
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) | |||
623 | if (!trigger) | 623 | if (!trigger) |
624 | break; | 624 | break; |
625 | 625 | ||
626 | check_for_release(cgrp); | ||
626 | cgroup_file_notify(&cgrp->events_file); | 627 | cgroup_file_notify(&cgrp->events_file); |
627 | 628 | ||
628 | cgrp = cgroup_parent(cgrp); | 629 | cgrp = cgroup_parent(cgrp); |
@@ -686,15 +687,8 @@ static void put_css_set_locked(struct css_set *cset) | |||
686 | css_set_count--; | 687 | css_set_count--; |
687 | 688 | ||
688 | list_for_each_entry_safe(link, tmp_link, &cset->cgrp_links, cgrp_link) { | 689 | list_for_each_entry_safe(link, tmp_link, &cset->cgrp_links, cgrp_link) { |
689 | struct cgroup *cgrp = link->cgrp; | ||
690 | |||
691 | list_del(&link->cset_link); | 690 | list_del(&link->cset_link); |
692 | list_del(&link->cgrp_link); | 691 | list_del(&link->cgrp_link); |
693 | |||
694 | /* @cgrp can't go away while we're holding css_set_rwsem */ | ||
695 | if (list_empty(&cgrp->cset_links)) | ||
696 | check_for_release(cgrp); | ||
697 | |||
698 | kfree(link); | 692 | kfree(link); |
699 | } | 693 | } |
700 | 694 | ||