* [PATCH for-next] RDMA/core: Flush workqueue before destroy it
@ 2021-04-06 8:34 Weihang Li
2021-04-06 8:45 ` Leon Romanovsky
0 siblings, 1 reply; 3+ messages in thread
From: Weihang Li @ 2021-04-06 8:34 UTC (permalink / raw)
To: dledford, jgg; +Cc: leon, linux-rdma, linuxarm
From: Yixian Liu <liuyixian@huawei.com>
It is safer to flush the workqueue before destroying it.
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
---
drivers/infiniband/core/addr.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
index 0abce00..e58a06b 100644
--- a/drivers/infiniband/core/addr.c
+++ b/drivers/infiniband/core/addr.c
@@ -883,6 +883,7 @@ int addr_init(void)
void addr_cleanup(void)
{
unregister_netevent_notifier(&nb);
+ flush_workqueue(addr_wq);
destroy_workqueue(addr_wq);
WARN_ON(!list_empty(&req_list));
}
--
2.8.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH for-next] RDMA/core: Flush workqueue before destroy it
2021-04-06 8:34 [PATCH for-next] RDMA/core: Flush workqueue before destroy it Weihang Li
@ 2021-04-06 8:45 ` Leon Romanovsky
2021-04-06 13:29 ` liweihang
0 siblings, 1 reply; 3+ messages in thread
From: Leon Romanovsky @ 2021-04-06 8:45 UTC (permalink / raw)
To: Weihang Li; +Cc: dledford, jgg, linux-rdma, linuxarm
On Tue, Apr 06, 2021 at 04:34:51PM +0800, Weihang Li wrote:
> From: Yixian Liu <liuyixian@huawei.com>
>
> It is safer to flush the workqueue before destroying it.
Sorry, safer for what?
destroy_workqueue() flushes workqueue internally. There is no need to do
it twice.
Thanks
>
> Signed-off-by: Yixian Liu <liuyixian@huawei.com>
> Signed-off-by: Weihang Li <liweihang@huawei.com>
> ---
> drivers/infiniband/core/addr.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
> index 0abce00..e58a06b 100644
> --- a/drivers/infiniband/core/addr.c
> +++ b/drivers/infiniband/core/addr.c
> @@ -883,6 +883,7 @@ int addr_init(void)
> void addr_cleanup(void)
> {
> unregister_netevent_notifier(&nb);
> + flush_workqueue(addr_wq);
> destroy_workqueue(addr_wq);
> WARN_ON(!list_empty(&req_list));
> }
> --
> 2.8.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH for-next] RDMA/core: Flush workqueue before destroy it
2021-04-06 8:45 ` Leon Romanovsky
@ 2021-04-06 13:29 ` liweihang
0 siblings, 0 replies; 3+ messages in thread
From: liweihang @ 2021-04-06 13:29 UTC (permalink / raw)
To: Leon Romanovsky; +Cc: dledford, jgg, linux-rdma, Linuxarm
On 2021/4/6 16:45, Leon Romanovsky wrote:
> On Tue, Apr 06, 2021 at 04:34:51PM +0800, Weihang Li wrote:
>> From: Yixian Liu <liuyixian@huawei.com>
>>
>> It is safer to flush the workqueue before destroying it.
> Sorry, safer for what?
>
> destroy_workqueue() flushes workqueue internally. There is no need to do
> it twice.
>
> Thanks
>
My bad, thank you for reminding :)
Weihang
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-04-06 13:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06 8:34 [PATCH for-next] RDMA/core: Flush workqueue before destroy it Weihang Li
2021-04-06 8:45 ` Leon Romanovsky
2021-04-06 13:29 ` liweihang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.