Skip to content
  • Lai Jiangshan's avatar
    workqueue: ensure attrs changes are properly synchronized · d4d3e257
    Lai Jiangshan authored
    
    
    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: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    d4d3e257