aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi Zefan <lizefan@huawei.com>2013-03-12 18:35:59 -0400
committerTejun Heo <tj@kernel.org>2013-03-12 18:35:59 -0400
commitd7eeac1913ff86a17f891cb4b73f03d4b94907d0 (patch)
tree1e44fde86b626dbeb7c27f007eeebce7d47ef206
parent6dc01181eac16192dc4a5d1b310b78e2e97c003c (diff)
cgroup: hold cgroup_mutex before calling css_offline()
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>
-rw-r--r--Documentation/cgroups/cgroups.txt1
-rw-r--r--kernel/cgroup.c11
2 files changed, 2 insertions, 10 deletions
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt
index bcf1a00b06a1..0028e888828c 100644
--- a/Documentation/cgroups/cgroups.txt
+++ b/Documentation/cgroups/cgroups.txt
@@ -580,6 +580,7 @@ propagation along the hierarchy. See the comment on
580cgroup_for_each_descendant_pre() for details. 580cgroup_for_each_descendant_pre() for details.
581 581
582void css_offline(struct cgroup *cgrp); 582void css_offline(struct cgroup *cgrp);
583(cgroup_mutex held by caller)
583 584
584This is the counterpart of css_online() and called iff css_online() 585This is the counterpart of css_online() and called iff css_online()
585has succeeded on @cgrp. This signifies the beginning of the end of 586has succeeded on @cgrp. This signifies the beginning of the end of
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index fd0b056d8da5..49297cbc134d 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4169,17 +4169,8 @@ static void offline_css(struct cgroup_subsys *ss, struct cgroup *cgrp)
4169 if (!(css->flags & CSS_ONLINE)) 4169 if (!(css->flags & CSS_ONLINE))
4170 return; 4170 return;
4171 4171
4172 /* 4172 if (ss->css_offline)
4173 * css_offline() should be called with cgroup_mutex unlocked. See
4174 * 3fa59dfbc3 ("cgroup: fix potential deadlock in pre_destroy") for
4175 * details. This temporary unlocking should go away once
4176 * cgroup_mutex is unexported from controllers.
4177 */
4178 if (ss->css_offline) {
4179 mutex_unlock(&cgroup_mutex);
4180 ss->css_offline(cgrp); 4173 ss->css_offline(cgrp);
4181 mutex_lock(&cgroup_mutex);
4182 }
4183 4174
4184 cgrp->subsys[ss->subsys_id]->flags &= ~CSS_ONLINE; 4175 cgrp->subsys[ss->subsys_id]->flags &= ~CSS_ONLINE;
4185} 4176}