Skip to contentSkip to conversation

nvme_fc: avoid workqueue flush stalls

PATCH New James Smart 3 participants 4 messages Sep 28, 2017 – Oct 22, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme_fc: avoid workqueue flush stalls

There's no need to wait for the full nvme_wq, which is now shared, to flush. flush only the delete_work item.

Signed-off-by James Smart <james.smart at broadcom.com>
---
 drivers/nvme/host/fc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/fc.c +1 -1
index ac898571b1e5..2bd94de09b8a 100644
@@ -2846,7 +2846,7 @@ nvme_fc_del_nvme_ctrl(struct nvme_ctrl *nctrl)
 	ret = __nvme_fc_del_ctrl(ctrl);
 
 	if (!ret)
-		flush_workqueue(nvme_wq);
+		flush_work(&ctrl->delete_work);
 
 	nvme_put_ctrl(&ctrl->ctrl);
 
Signature · 1 line
2.13.1
maintainer
#1 lore raw

PATCH 1/1 nvme_fc: avoid workqueue flush stalls

Quoted 3 lines

There's no need to wait for the full nvme_wq, which is now shared, to flush. flush only the delete_work item.

The patch looks correct, but can you explain what stalled that this patch fixes?

#2 lore raw

PATCH 1/1 nvme_fc: avoid workqueue flush stalls

Quoted 6 lines · Sagi Grimberg
Quoted 3 lines

There's no need to wait for the full nvme_wq, which is now shared, to flush. flush only the delete_work item.

The patch looks correct, but can you explain what stalled that this patch fixes?

I don't have an explicit failure case. While reviewing the code for the other stall issue with fatal_err_work, I realized that this flush is now waiting on a work queue shared by everything nvmf.? It used to be solely a nvme-fc transport workqueue. There's no need for waiting on anything more than the delete work item. And having it raise in scope of the nvmf thread perhaps makes it wait for a lot of other unnecessary things - slowing it down.

If you're ok with it - can you Ack/Review it ?

-- james

maintainer
#3 lore raw

PATCH 1/1 nvme_fc: avoid workqueue flush stalls

Quoted 15 lines
Quoted 6 lines
Quoted 3 lines

There's no need to wait for the full nvme_wq, which is now shared, to flush. flush only the delete_work item.

The patch looks correct, but can you explain what stalled that this patch fixes?

I don't have an explicit failure case. While reviewing the code for the other stall issue with fatal_err_work, I realized that this flush is now waiting on a work queue shared by everything nvmf.? It used to be solely a nvme-fc transport workqueue. There's no need for waiting on anything more than the delete work item. And having it raise in scope of the nvmf thread perhaps makes it wait for a lot of other unnecessary things - slowing it down.

Quoted 1 line

If you're ok with it - can you Ack/Review it ?

Reviewed-by Sagi Grimberg <sagi at grimberg.me>