* [PATCH wq/for-next 1/2] workqueue: replace open-coded work_pending()
@ 2021-06-02 11:16 Julian Wiedmann
2021-06-02 11:16 ` [PATCH wq/for-next 2/2] workqueue: clean up for_each_pwq()'s documentation Julian Wiedmann
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Julian Wiedmann @ 2021-06-02 11:16 UTC (permalink / raw)
To: Tejun Heo; +Cc: Julian Wiedmann, Lai Jiangshan, linux-kernel
Use the right helper to check whether a work item is currently pending.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
---
kernel/workqueue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 50142fc08902..8a700ccfa313 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3209,7 +3209,7 @@ EXPORT_SYMBOL(flush_delayed_work);
*/
bool flush_rcu_work(struct rcu_work *rwork)
{
- if (test_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(&rwork->work))) {
+ if (work_pending(&rwork->work)) {
rcu_barrier();
flush_work(&rwork->work);
return true;
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH wq/for-next 2/2] workqueue: clean up for_each_pwq()'s documentation
2021-06-02 11:16 [PATCH wq/for-next 1/2] workqueue: replace open-coded work_pending() Julian Wiedmann
@ 2021-06-02 11:16 ` Julian Wiedmann
2021-06-04 14:53 ` Tejun Heo
2021-06-03 2:20 ` [PATCH wq/for-next 1/2] workqueue: replace open-coded work_pending() Lai Jiangshan
2021-06-04 14:53 ` Tejun Heo
2 siblings, 1 reply; 5+ messages in thread
From: Julian Wiedmann @ 2021-06-02 11:16 UTC (permalink / raw)
To: Tejun Heo; +Cc: Julian Wiedmann, Lai Jiangshan, linux-kernel
The if/else clause was removed with commit 5a6446626d7e
("workqueue: Convert for_each_wq to use built-in list check").
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
---
kernel/workqueue.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 8a700ccfa313..104e3ef04e33 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -418,9 +418,6 @@ static void show_pwq(struct pool_workqueue *pwq);
* This must be called either with wq->mutex held or RCU read locked.
* If the pwq needs to be used beyond the locking in effect, the caller is
* responsible for guaranteeing that the pwq stays online.
- *
- * The if/else clause exists only for the lockdep assertion and can be
- * ignored.
*/
#define for_each_pwq(pwq, wq) \
list_for_each_entry_rcu((pwq), &(wq)->pwqs, pwqs_node, \
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH wq/for-next 1/2] workqueue: replace open-coded work_pending()
2021-06-02 11:16 [PATCH wq/for-next 1/2] workqueue: replace open-coded work_pending() Julian Wiedmann
2021-06-02 11:16 ` [PATCH wq/for-next 2/2] workqueue: clean up for_each_pwq()'s documentation Julian Wiedmann
@ 2021-06-03 2:20 ` Lai Jiangshan
2021-06-04 14:53 ` Tejun Heo
2 siblings, 0 replies; 5+ messages in thread
From: Lai Jiangshan @ 2021-06-03 2:20 UTC (permalink / raw)
To: Julian Wiedmann; +Cc: Tejun Heo, LKML
For both of these patches
Reviewed-by: Lai Jiangshan <jiangshanlai@gmail.com>
On Wed, Jun 2, 2021 at 7:17 PM Julian Wiedmann <jwi@linux.ibm.com> wrote:
>
> Use the right helper to check whether a work item is currently pending.
>
> Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
> ---
> kernel/workqueue.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> index 50142fc08902..8a700ccfa313 100644
> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -3209,7 +3209,7 @@ EXPORT_SYMBOL(flush_delayed_work);
> */
> bool flush_rcu_work(struct rcu_work *rwork)
> {
> - if (test_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(&rwork->work))) {
> + if (work_pending(&rwork->work)) {
> rcu_barrier();
> flush_work(&rwork->work);
> return true;
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH wq/for-next 1/2] workqueue: replace open-coded work_pending()
2021-06-02 11:16 [PATCH wq/for-next 1/2] workqueue: replace open-coded work_pending() Julian Wiedmann
2021-06-02 11:16 ` [PATCH wq/for-next 2/2] workqueue: clean up for_each_pwq()'s documentation Julian Wiedmann
2021-06-03 2:20 ` [PATCH wq/for-next 1/2] workqueue: replace open-coded work_pending() Lai Jiangshan
@ 2021-06-04 14:53 ` Tejun Heo
2 siblings, 0 replies; 5+ messages in thread
From: Tejun Heo @ 2021-06-04 14:53 UTC (permalink / raw)
To: Julian Wiedmann; +Cc: Lai Jiangshan, linux-kernel
On Wed, Jun 02, 2021 at 01:16:54PM +0200, Julian Wiedmann wrote:
> Use the right helper to check whether a work item is currently pending.
>
> Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Applied to wq/for-5.14.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-06-04 14:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02 11:16 [PATCH wq/for-next 1/2] workqueue: replace open-coded work_pending() Julian Wiedmann
2021-06-02 11:16 ` [PATCH wq/for-next 2/2] workqueue: clean up for_each_pwq()'s documentation Julian Wiedmann
2021-06-04 14:53 ` Tejun Heo
2021-06-03 2:20 ` [PATCH wq/for-next 1/2] workqueue: replace open-coded work_pending() Lai Jiangshan
2021-06-04 14:53 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).