]> git.karo-electronics.de Git - linux-beck.git/commitdiff
cgroup: relocate setting of CGRP_DEAD
authorTejun Heo <tj@kernel.org>
Wed, 19 Mar 2014 14:23:53 +0000 (10:23 -0400)
committerTejun Heo <tj@kernel.org>
Wed, 19 Mar 2014 14:23:53 +0000 (10:23 -0400)
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>
kernel/cgroup.c

index 306ad0ed19efdc14aebc62f5b72661d3194fc19a..b604c7e0cfc6d1cf75732950e3b97e5a221f3944 100644 (file)
@@ -3867,6 +3867,15 @@ static int cgroup_destroy_locked(struct cgroup *cgrp)
        if (!empty)
                return -EBUSY;
 
+       /*
+        * Mark @cgrp dead.  This prevents further task migration and child
+        * creation by disabling cgroup_lock_live_group().  Note that
+        * CGRP_DEAD assertion is depended upon by css_next_child() to
+        * resume iteration after dropping RCU read lock.  See
+        * css_next_child() for details.
+        */
+       set_bit(CGRP_DEAD, &cgrp->flags);
+
        /*
         * Initiate massacre of all css's.  cgroup_destroy_css_killed()
         * will be invoked to perform the rest of destruction once the
@@ -3878,15 +3887,6 @@ static int cgroup_destroy_locked(struct cgroup *cgrp)
                kill_css(css);
        mutex_lock(&cgroup_mutex);
 
-       /*
-        * Mark @cgrp dead.  This prevents further task migration and child
-        * creation by disabling cgroup_lock_live_group().  Note that
-        * CGRP_DEAD assertion is depended upon by css_next_child() to
-        * resume iteration after dropping RCU read lock.  See
-        * css_next_child() for details.
-        */
-       set_bit(CGRP_DEAD, &cgrp->flags);
-
        /* CGRP_DEAD is set, remove from ->release_list for the last time */
        raw_spin_lock(&release_list_lock);
        if (!list_empty(&cgrp->release_list))