diff options
author | Tejun Heo <tj@kernel.org> | 2014-03-19 10:23:53 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-03-19 10:23:53 -0400 |
commit | 5d77381fd8aa631a8fda718c395da1319afb5d2d (patch) | |
tree | 60c8d92fa51eb74238d4ecb92966b71c3ad03751 | |
parent | b8dadcb58d542ecbf1d3dae5fefcd3fd8cb26539 (diff) |
cgroup: relocate setting of CGRP_DEAD
In cgroup_destroy_locked(), move setting of CGRP_DEAD above
invocations of kill_css(). This doesn't make any visible behavior
difference now but will be used to inhibit manipulating controller
enable states of a dying cgroup on the unified hierarchy.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
-rw-r--r-- | kernel/cgroup.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 306ad0ed19ef..b604c7e0cfc6 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -3868,6 +3868,15 @@ static int cgroup_destroy_locked(struct cgroup *cgrp) | |||
3868 | return -EBUSY; | 3868 | return -EBUSY; |
3869 | 3869 | ||
3870 | /* | 3870 | /* |
3871 | * Mark @cgrp dead. This prevents further task migration and child | ||
3872 | * creation by disabling cgroup_lock_live_group(). Note that | ||
3873 | * CGRP_DEAD assertion is depended upon by css_next_child() to | ||
3874 | * resume iteration after dropping RCU read lock. See | ||
3875 | * css_next_child() for details. | ||
3876 | */ | ||
3877 | set_bit(CGRP_DEAD, &cgrp->flags); | ||
3878 | |||
3879 | /* | ||
3871 | * Initiate massacre of all css's. cgroup_destroy_css_killed() | 3880 | * Initiate massacre of all css's. cgroup_destroy_css_killed() |
3872 | * will be invoked to perform the rest of destruction once the | 3881 | * will be invoked to perform the rest of destruction once the |
3873 | * percpu refs of all css's are confirmed to be killed. This | 3882 | * percpu refs of all css's are confirmed to be killed. This |
@@ -3878,15 +3887,6 @@ static int cgroup_destroy_locked(struct cgroup *cgrp) | |||
3878 | kill_css(css); | 3887 | kill_css(css); |
3879 | mutex_lock(&cgroup_mutex); | 3888 | mutex_lock(&cgroup_mutex); |
3880 | 3889 | ||
3881 | /* | ||
3882 | * Mark @cgrp dead. This prevents further task migration and child | ||
3883 | * creation by disabling cgroup_lock_live_group(). Note that | ||
3884 | * CGRP_DEAD assertion is depended upon by css_next_child() to | ||
3885 | * resume iteration after dropping RCU read lock. See | ||
3886 | * css_next_child() for details. | ||
3887 | */ | ||
3888 | set_bit(CGRP_DEAD, &cgrp->flags); | ||
3889 | |||
3890 | /* CGRP_DEAD is set, remove from ->release_list for the last time */ | 3890 | /* CGRP_DEAD is set, remove from ->release_list for the last time */ |
3891 | raw_spin_lock(&release_list_lock); | 3891 | raw_spin_lock(&release_list_lock); |
3892 | if (!list_empty(&cgrp->release_list)) | 3892 | if (!list_empty(&cgrp->release_list)) |