linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] nvme: don't wait freeze during resetting
@ 2022-09-26  1:34 Ming Lei
  2022-10-10  8:25 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Ming Lei @ 2022-09-26  1:34 UTC (permalink / raw)
  To: Christoph Hellwig, linux-nvme
  Cc: Yi Zhang, Ming Lei, Sagi Grimberg, Chao Leng, Keith Busch

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.

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chao Leng <lengchao@huawei.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
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(-)

diff --git a/drivers/nvme/host/apple.c b/drivers/nvme/host/apple.c
index 5fc5ea196b40..9cd02b57fc85 100644
--- a/drivers/nvme/host/apple.c
+++ b/drivers/nvme/host/apple.c
@@ -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);
 
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 98864b853eef..985b216907fc 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -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
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH V2] nvme: don't wait freeze during resetting
  2022-09-26  1:34 [PATCH V2] nvme: don't wait freeze during resetting Ming Lei
@ 2022-10-10  8:25 ` Christoph Hellwig
  2022-10-18  6:29   ` Ming Lei
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2022-10-10  8:25 UTC (permalink / raw)
  To: Ming Lei
  Cc: Christoph Hellwig, linux-nvme, Yi Zhang, Sagi Grimberg,
	Chao Leng, Keith Busch

On Mon, Sep 26, 2022 at 09:34:04AM +0800, Ming Lei wrote:
> 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.
> 
> Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
> Reviewed-by: Chao Leng <lengchao@huawei.com>
> Reviewed-by: Keith Busch <kbusch@kernel.org>
> Signed-off-by: Ming Lei <ming.lei@redhat.com>
> ---
> 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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH V2] nvme: don't wait freeze during resetting
  2022-10-10  8:25 ` Christoph Hellwig
@ 2022-10-18  6:29   ` Ming Lei
  0 siblings, 0 replies; 3+ messages in thread
From: Ming Lei @ 2022-10-18  6:29 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-nvme, Yi Zhang, Sagi Grimberg, Chao Leng, Keith Busch

On Mon, Oct 10, 2022 at 10:25:33AM +0200, Christoph Hellwig wrote:
> On Mon, Sep 26, 2022 at 09:34:04AM +0800, Ming Lei wrote:
> > 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.
> > 
> > Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
> > Reviewed-by: Chao Leng <lengchao@huawei.com>
> > Reviewed-by: Keith Busch <kbusch@kernel.org>
> > Signed-off-by: Ming Lei <ming.lei@redhat.com>
> > ---
> > 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?

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.

> 
> 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-18  6:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-26  1:34 [PATCH V2] nvme: don't wait freeze during resetting Ming Lei
2022-10-10  8:25 ` Christoph Hellwig
2022-10-18  6:29   ` Ming Lei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).