• L
    workqueue: ensure attrs changes are properly synchronized · d4d3e257
    Lai Jiangshan 提交于
    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: NLai Jiangshan <laijs@cn.fujitsu.com>
    Signed-off-by: NTejun Heo <tj@kernel.org>
    d4d3e257
workqueue.c 146.5 KB