Skip to contentSkip to conversation

nvme: don't wait freeze during resetting

PATCH In review Ming Lei 2 participants 3 messages Sep 26, 2022 – Oct 18, 2022

Subsystems (2)
lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH v2 1/1 nvme: don't wait freeze during resetting

First it isn't necessary to call nvme_wait_freeze during reset. For nvme-pci, if tagset isn't allocated, there can't be any inflight IOs; otherwise blk_mq_update_nr_hw_queues can freeze & wait queues.

Second, since commit bdd6316094e0 ("block: Allow unfreezing of a queue while requests are in progress"), it is fine to unfreeze queue without draining inflight IOs.

---
V2:
- remove the change in rdma/tcp which may make non-mpath reset time much longer, as pointed by Sagi

 drivers/nvme/host/apple.c | 1 -
 drivers/nvme/host/pci.c   | 1 -
 2 files changed, 2 deletions(-)
drivers/nvme/host/apple.c +0 -1
index 5fc5ea196b40..9cd02b57fc85 100644
@@ -1126,7 +1126,6 @@ static void apple_nvme_reset_work(struct work_struct *work)
 	anv->ctrl.queue_count = nr_io_queues + 1;
 
 	nvme_start_queues(&anv->ctrl);
-	nvme_wait_freeze(&anv->ctrl);
 	blk_mq_update_nr_hw_queues(&anv->tagset, 1);
 	nvme_unfreeze(&anv->ctrl);
 
drivers/nvme/host/pci.c +0 -1
index 98864b853eef..985b216907fc 100644
@@ -2910,7 +2910,6 @@ static void nvme_reset_work(struct work_struct *work)
 		nvme_free_tagset(dev);
 	} else {
 		nvme_start_queues(&dev->ctrl);
-		nvme_wait_freeze(&dev->ctrl);
 		if (!dev->ctrl.tagset)
 			nvme_pci_alloc_tag_set(dev);
 		else
Signature · 1 line
2.31.1
#1 lore raw
Quoted 8 lines · Ming Lei

First it isn't necessary to call nvme_wait_freeze during reset. For nvme-pci, if tagset isn't allocated, there can't be any inflight IOs; otherwise blk_mq_update_nr_hw_queues can freeze & wait queues.

Second, since commit bdd6316094e0 ("block: Allow unfreezing of a queue while requests are in progress"), it is fine to unfreeze queue without draining inflight IOs.

Quoted 8 lines

---
V2:
- remove the change in rdma/tcp which may make non-mpath reset time much longer, as pointed by Sagi

So how can this be corret for PCI and apple but not for rdma and TCP?

Also please don't update two drivers in a single patch.

author
#2 lore raw
Quoted 18 lines · Christoph Hellwig
Quoted 8 lines · Ming Lei

First it isn't necessary to call nvme_wait_freeze during reset. For nvme-pci, if tagset isn't allocated, there can't be any inflight IOs; otherwise blk_mq_update_nr_hw_queues can freeze & wait queues.

Second, since commit bdd6316094e0 ("block: Allow unfreezing of a queue while requests are in progress"), it is fine to unfreeze queue without draining inflight IOs.

Quoted 8 lines

---
V2:
- remove the change in rdma/tcp which may make non-mpath reset time much longer, as pointed by Sagi

Quoted 1 line

So how can this be corret for PCI and apple but not for rdma and TCP?

It doesn't mean it isn't correct for rdma and TCP, just the similar patch may increase timeout delay a lot for the two, nvme_wait_freeze_timeout(ctrl, NVME_IO_TIMEOUT) waits 30 secs at default, but nvme_wait_freeze() may wait much longer if retry is involved.

Quoted 2 lines

Also please don't update two drivers in a single patch.

But the change is same for both two, and we have lots of such example, same change on lots of subsystem.

thanks,
Ming