[PATCH] xen/pvcalls-back: Remove redundant 'flush_workqueue()' calls

Christophe JAILLET posted 1 patch 2 years, 6 months ago
Failed in applying to current master (apply log)
drivers/xen/pvcalls-back.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] xen/pvcalls-back: Remove redundant 'flush_workqueue()' calls
Posted by Christophe JAILLET 2 years, 6 months ago
'destroy_workqueue()' already drains the queue before destroying it, so
there is no need to flush it explicitly.

Remove the redundant 'flush_workqueue()' calls.

This was generated with coccinelle:

@@
expression E;
@@
- 	flush_workqueue(E);
	destroy_workqueue(E);

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/xen/pvcalls-back.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c
index b47fd8435061..d6f945fd4147 100644
--- a/drivers/xen/pvcalls-back.c
+++ b/drivers/xen/pvcalls-back.c
@@ -465,7 +465,6 @@ static int pvcalls_back_release_passive(struct xenbus_device *dev,
 		write_unlock_bh(&mappass->sock->sk->sk_callback_lock);
 	}
 	sock_release(mappass->sock);
-	flush_workqueue(mappass->wq);
 	destroy_workqueue(mappass->wq);
 	kfree(mappass);
 
-- 
2.30.2


Re: [PATCH] xen/pvcalls-back: Remove redundant 'flush_workqueue()' calls
Posted by Stefano Stabellini 2 years, 6 months ago
On Thu, 14 Oct 2021, Christophe JAILLET wrote:
> 'destroy_workqueue()' already drains the queue before destroying it, so
> there is no need to flush it explicitly.
> 
> Remove the redundant 'flush_workqueue()' calls.
> 
> This was generated with coccinelle:
> 
> @@
> expression E;
> @@
> - 	flush_workqueue(E);
> 	destroy_workqueue(E);
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  drivers/xen/pvcalls-back.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c
> index b47fd8435061..d6f945fd4147 100644
> --- a/drivers/xen/pvcalls-back.c
> +++ b/drivers/xen/pvcalls-back.c
> @@ -465,7 +465,6 @@ static int pvcalls_back_release_passive(struct xenbus_device *dev,
>  		write_unlock_bh(&mappass->sock->sk->sk_callback_lock);
>  	}
>  	sock_release(mappass->sock);
> -	flush_workqueue(mappass->wq);
>  	destroy_workqueue(mappass->wq);
>  	kfree(mappass);
>  
> -- 
> 2.30.2
> 

Re: [PATCH] xen/pvcalls-back: Remove redundant 'flush_workqueue()' calls
Posted by Boris Ostrovsky 2 years, 6 months ago
On 10/14/21 3:42 PM, Stefano Stabellini wrote:
> On Thu, 14 Oct 2021, Christophe JAILLET wrote:
>> 'destroy_workqueue()' already drains the queue before destroying it, so
>> there is no need to flush it explicitly.
>>
>> Remove the redundant 'flush_workqueue()' calls.
>>
>> This was generated with coccinelle:
>>
>> @@
>> expression E;
>> @@
>> - 	flush_workqueue(E);
>> 	destroy_workqueue(E);
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
>

Applied to for-linus-5.16


-boris