workqueue: ensure attrs changes are properly synchronized
authorLai Jiangshan <laijs@cn.fujitsu.com>
Tue, 19 May 2015 10:03:48 +0000 (18:03 +0800)
committerTejun Heo <tj@kernel.org>
Tue, 19 May 2015 21:37:00 +0000 (17:37 -0400)
Current modification to attrs via sysfs is not fully synchronized.

Process A (change cpumask)      | Process B (change numa affinity)
wq_cpumask_store()              |
  wq_sysfs_prep_attrs()         |
                                | apply_workqueue_attrs()
  apply_workqueue_attrs()       |

It results that the Process B's operation is totally reverted
without any notification, it is a buggy behavior.  So this patch
moves wq_sysfs_prep_attrs() into the protection under wq_pool_mutex
to ensure attrs changes are properly synchronized.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/workqueue.c

Simple merge