diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2015-05-20 02:41:18 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2015-05-21 17:26:22 -0400 |
commit | 899a94fe15a8e928277ff0d0402c086fa67fe16f (patch) | |
tree | ef82ff159b3fffde2c76f6502f0ce82f5896b954 | |
parent | da7f91b2e2c6176f95ca7b538d74dc70c5d11ded (diff) |
workqueue: remove the lock from wq_sysfs_prep_attrs()
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>
-rw-r--r-- | kernel/workqueue.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index bd4b24d3489d..ad8dc2b9efc3 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -4937,13 +4937,13 @@ static struct workqueue_attrs *wq_sysfs_prep_attrs(struct workqueue_struct *wq) | |||
4937 | { | 4937 | { |
4938 | struct workqueue_attrs *attrs; | 4938 | struct workqueue_attrs *attrs; |
4939 | 4939 | ||
4940 | lockdep_assert_held(&wq_pool_mutex); | ||
4941 | |||
4940 | attrs = alloc_workqueue_attrs(GFP_KERNEL); | 4942 | attrs = alloc_workqueue_attrs(GFP_KERNEL); |
4941 | if (!attrs) | 4943 | if (!attrs) |
4942 | return NULL; | 4944 | return NULL; |
4943 | 4945 | ||
4944 | mutex_lock(&wq->mutex); | ||
4945 | copy_workqueue_attrs(attrs, wq->unbound_attrs); | 4946 | copy_workqueue_attrs(attrs, wq->unbound_attrs); |
4946 | mutex_unlock(&wq->mutex); | ||
4947 | return attrs; | 4947 | return attrs; |
4948 | } | 4948 | } |
4949 | 4949 | ||