cgroup: hold cgroup_mutex before calling css_offline()
authorLi Zefan <lizefan@huawei.com>
Tue, 12 Mar 2013 22:35:59 +0000 (15:35 -0700)
committerTejun Heo <tj@kernel.org>
Tue, 12 Mar 2013 22:35:59 +0000 (15:35 -0700)
cpuset no longer nests cgroup_mutex inside cpu_hotplug lock, so
we don't have to release cgroup_mutex before calling css_offline().

Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Documentation/cgroups/cgroups.txt
kernel/cgroup.c

index bcf1a00b06a1e7e09042c5dfc354ce3b94e45ae0..0028e888828cf3d3c691b151ed5ecb15e5d1ca3f 100644 (file)
@@ -580,6 +580,7 @@ propagation along the hierarchy. See the comment on
 cgroup_for_each_descendant_pre() for details.
 
 void css_offline(struct cgroup *cgrp);
+(cgroup_mutex held by caller)
 
 This is the counterpart of css_online() and called iff css_online()
 has succeeded on @cgrp. This signifies the beginning of the end of
index fd0b056d8da537e74789b1c81314c0e51caa1169..49297cbc134d49a201b2c019eb162e71213a699f 100644 (file)
@@ -4169,17 +4169,8 @@ static void offline_css(struct cgroup_subsys *ss, struct cgroup *cgrp)
        if (!(css->flags & CSS_ONLINE))
                return;
 
-       /*
-        * css_offline() should be called with cgroup_mutex unlocked.  See
-        * 3fa59dfbc3 ("cgroup: fix potential deadlock in pre_destroy") for
-        * details.  This temporary unlocking should go away once
-        * cgroup_mutex is unexported from controllers.
-        */
-       if (ss->css_offline) {
-               mutex_unlock(&cgroup_mutex);
+       if (ss->css_offline)
                ss->css_offline(cgrp);
-               mutex_lock(&cgroup_mutex);
-       }
 
        cgrp->subsys[ss->subsys_id]->flags &= ~CSS_ONLINE;
 }