Skip to content

Commit

Permalink
workqueue: remove the lock from wq_sysfs_prep_attrs()
Browse files Browse the repository at this point in the history
Reading to wq->unbound_attrs requires protection of either wq_pool_mutex
or wq->mutex, and wq_sysfs_prep_attrs() is called with wq_pool_mutex held,
so we don't need to grab wq->mutex here.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Lai Jiangshan authored and Tejun Heo committed May 21, 2015
1 parent da7f91b commit 899a94f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -4937,13 +4937,13 @@ static struct workqueue_attrs *wq_sysfs_prep_attrs(struct workqueue_struct *wq)
{
struct workqueue_attrs *attrs;

lockdep_assert_held(&wq_pool_mutex);

attrs = alloc_workqueue_attrs(GFP_KERNEL);
if (!attrs)
return NULL;

mutex_lock(&wq->mutex);
copy_workqueue_attrs(attrs, wq->unbound_attrs);
mutex_unlock(&wq->mutex);
return attrs;
}

Expand Down

0 comments on commit 899a94f

Please sign in to comment.