Skip to content

Commit ba9182a

Browse files
Waiman-Longhtejun
authored andcommitted
cgroup/cpuset: Wake up cpuset_attach_wq tasks in cpuset_cancel_attach()
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>
1 parent 57dcd64 commit ba9182a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

kernel/cgroup/cpuset.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2502,11 +2502,15 @@ static int cpuset_can_attach(struct cgroup_taskset *tset)
25022502
static void cpuset_cancel_attach(struct cgroup_taskset *tset)
25032503
{
25042504
struct cgroup_subsys_state *css;
2505+
struct cpuset *cs;
25052506

25062507
cgroup_taskset_first(tset, &css);
2508+
cs = css_cs(css);
25072509

25082510
percpu_down_write(&cpuset_rwsem);
2509-
css_cs(css)->attach_in_progress--;
2511+
cs->attach_in_progress--;
2512+
if (!cs->attach_in_progress)
2513+
wake_up(&cpuset_attach_wq);
25102514
percpu_up_write(&cpuset_rwsem);
25112515
}
25122516

0 commit comments

Comments
 (0)