Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7eeac19 authored by Li Zefan's avatar Li Zefan Committed by Tejun Heo
Browse files

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: default avatarLi Zefan <lizefan@huawei.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 6dc01181
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -580,6 +580,7 @@ propagation along the hierarchy. See the comment on
cgroup_for_each_descendant_pre() for details.
cgroup_for_each_descendant_pre() for details.


void css_offline(struct cgroup *cgrp);
void css_offline(struct cgroup *cgrp);
(cgroup_mutex held by caller)


This is the counterpart of css_online() and called iff css_online()
This is the counterpart of css_online() and called iff css_online()
has succeeded on @cgrp. This signifies the beginning of the end of
has succeeded on @cgrp. This signifies the beginning of the end of
+1 −10
Original line number Original line Diff line number Diff line
@@ -4169,17 +4169,8 @@ static void offline_css(struct cgroup_subsys *ss, struct cgroup *cgrp)
	if (!(css->flags & CSS_ONLINE))
	if (!(css->flags & CSS_ONLINE))
		return;
		return;


	/*
	if (ss->css_offline)
	 * 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);
		ss->css_offline(cgrp);
		ss->css_offline(cgrp);
		mutex_lock(&cgroup_mutex);
	}


	cgrp->subsys[ss->subsys_id]->flags &= ~CSS_ONLINE;
	cgrp->subsys[ss->subsys_id]->flags &= ~CSS_ONLINE;
}
}