* [PATCH] workqueue: remove the stale comment in pwq_unbound_release_workfn()
@ 2014-07-22 5:04 Lai Jiangshan
2014-07-22 15:33 ` Tejun Heo
0 siblings, 1 reply; 2+ messages in thread
From: Lai Jiangshan @ 2014-07-22 5:04 UTC (permalink / raw)
To: linux-kernel; +Cc: Tejun Heo, Lai Jiangshan
In 75ccf5950f82 ("workqueue: prepare flush_workqueue() for dynamic
creation and destrucion of unbound pool_workqueues"), a comment
about the synchronization for the pwq in pwq_unbound_release_workfn()
was added. The comment clained the flush_mutex was isn't strictly
necessary, it was correct in that time, due to the pwq was protected
by workqueue_lock.
But it is incorrect now since the wq->flush_mutex was renamed to
wq->mutex and workqueue_lock was removed, the wq->mutex is strictly
needed. But the comment was miss-updated when the synchronization
was changed.
This patch removes the incorrect comments directly, and it doesn't
add any new comment to explain why wq->mutex is needed here,
which is definitely obvious and wq->pwqs_node has "WQ" notation
in its definition which is better comment.
The old commit mentioned above also introduced a comment in link_pwq()
about the synchronization. This comment is also removed in this patch
since the whole link_pwq() is proteced by wq->mutex.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
kernel/workqueue.c | 10 +---------
1 files changed, 1 insertions(+), 9 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 942103d9..b8990cf 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3527,11 +3527,6 @@ static void pwq_unbound_release_workfn(struct work_struct *work)
if (WARN_ON_ONCE(!(wq->flags & WQ_UNBOUND)))
return;
- /*
- * Unlink @pwq. Synchronization against wq->mutex isn't strictly
- * necessary on release but do it anyway. It's easier to verify
- * and consistent with the linking path.
- */
mutex_lock(&wq->mutex);
list_del_rcu(&pwq->pwqs_node);
is_last = list_empty(&wq->pwqs);
@@ -3628,10 +3623,7 @@ static void link_pwq(struct pool_workqueue *pwq)
if (!list_empty(&pwq->pwqs_node))
return;
- /*
- * Set the matching work_color. This is synchronized with
- * wq->mutex to avoid confusing flush_workqueue().
- */
+ /* Set the matching work_color. */
pwq->work_color = wq->work_color;
/* sync max_active to the current setting */
--
1.7.4.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] workqueue: remove the stale comment in pwq_unbound_release_workfn()
2014-07-22 5:04 [PATCH] workqueue: remove the stale comment in pwq_unbound_release_workfn() Lai Jiangshan
@ 2014-07-22 15:33 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2014-07-22 15:33 UTC (permalink / raw)
To: Lai Jiangshan; +Cc: linux-kernel
On Tue, Jul 22, 2014 at 01:04:27PM +0800, Lai Jiangshan wrote:
> In 75ccf5950f82 ("workqueue: prepare flush_workqueue() for dynamic
> creation and destrucion of unbound pool_workqueues"), a comment
> about the synchronization for the pwq in pwq_unbound_release_workfn()
> was added. The comment clained the flush_mutex was isn't strictly
> necessary, it was correct in that time, due to the pwq was protected
> by workqueue_lock.
>
> But it is incorrect now since the wq->flush_mutex was renamed to
> wq->mutex and workqueue_lock was removed, the wq->mutex is strictly
> needed. But the comment was miss-updated when the synchronization
> was changed.
>
> This patch removes the incorrect comments directly, and it doesn't
> add any new comment to explain why wq->mutex is needed here,
> which is definitely obvious and wq->pwqs_node has "WQ" notation
> in its definition which is better comment.
>
> The old commit mentioned above also introduced a comment in link_pwq()
> about the synchronization. This comment is also removed in this patch
> since the whole link_pwq() is proteced by wq->mutex.
>
> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Applied to wq/for-3.17.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-22 15:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-22 5:04 [PATCH] workqueue: remove the stale comment in pwq_unbound_release_workfn() Lai Jiangshan
2014-07-22 15:33 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®