Skip to content

Commit 303ded3

Browse files
Waiman-Longsmb49
authored andcommitted
cgroup/cpuset: Wake up cpuset_attach_wq tasks in cpuset_cancel_attach()
BugLink: https://bugs.launchpad.net/bugs/2023328 commit ba9182a upstream. After a successful cpuset_can_attach() call which increments the attach_in_progress flag, either cpuset_cancel_attach() or cpuset_attach() will be called later. In cpuset_attach(), tasks in cpuset_attach_wq, if present, will be woken up at the end. That is not the case in cpuset_cancel_attach(). So missed wakeup is possible if the attach operation is somehow cancelled. Fix that by doing the wakeup in cpuset_cancel_attach() as well. Fixes: e44193d ("cpuset: let hotplug propagation work wait for task attaching") Signed-off-by: Waiman Long <longman@redhat.com> Reviewed-by: Michal Koutný <mkoutny@suse.com> Cc: stable@vger.kernel.org # v3.11+ Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Luke Nowakowski-Krijger <luke.nowakowskikrijger@canonical.com>
1 parent 1e29247 commit 303ded3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

kernel/cgroup/cpuset.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2225,11 +2225,15 @@ static int cpuset_can_attach(struct cgroup_taskset *tset)
22252225
static void cpuset_cancel_attach(struct cgroup_taskset *tset)
22262226
{
22272227
struct cgroup_subsys_state *css;
2228+
struct cpuset *cs;
22282229

22292230
cgroup_taskset_first(tset, &css);
2231+
cs = css_cs(css);
22302232

22312233
percpu_down_write(&cpuset_rwsem);
2232-
css_cs(css)->attach_in_progress--;
2234+
cs->attach_in_progress--;
2235+
if (!cs->attach_in_progress)
2236+
wake_up(&cpuset_attach_wq);
22332237
percpu_up_write(&cpuset_rwsem);
22342238
}
22352239

0 commit comments

Comments
 (0)