Skip to contentSkip to conversation

RDMA/core: Flush workqueue before destroy it

PATCH In review Weihang Li 2 participants 3 messages Apr 6, 2021 InfiniBand

lore
Share & tools
lore

Weihang Li

author
#0 lore raw

PATCH 1/1 RDMA/core: Flush workqueue before destroy it

From: Yixian Liu <[email protected]>

It is safer to flush the workqueue before destroying it.

---
 drivers/infiniband/core/addr.c | 1 +
 1 file changed, 1 insertion(+)
drivers/infiniband/core/addr.c +1 -0
index 0abce00..e58a06b 100644
@@ -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));
 }
Signature · 1 line
2.8.1
#1 lore raw
Quoted 3 lines · Weihang Li

From: Yixian Liu <[email protected]>

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

Quoted 22 lines
---
 drivers/infiniband/core/addr.c | 1 +
 1 file changed, 1 insertion(+)
drivers/infiniband/core/addr.c +1 -0
index 0abce00..e58a06b 100644
@@ -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));
 }
Signature · 1 line
2.8.1
author
#2 lore raw
Quoted 11 lines · Leon Romanovsky
Quoted 3 lines · Weihang Li

From: Yixian Liu <[email protected]>

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