All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme-pci: report the actual number of tagset maps
@ 2022-09-26 21:01 Keith Busch
  2022-09-27  7:21 ` Christoph Hellwig
  2022-09-28  7:01 ` Sagi Grimberg
  0 siblings, 2 replies; 3+ messages in thread
From: Keith Busch @ 2022-09-26 21:01 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, Keith Busch

From: Keith Busch <kbusch@kernel.org>

We've been reporting 2 maps regardless of whether the module parameter
asked for anything beyond the default queues. A consequence of this
means that blk-mq will reinitialize the all the hardware contexts and io
schedulers on every controller reset when the mapping is exactly the
same as before. This unnecessary overhead is adding several milliseconds
on a reset for environments that don't need it. Report the actual number
of mappings in use.

Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 drivers/nvme/host/pci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 70b1922c8953..59fa2490b646 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2526,9 +2526,11 @@ static void nvme_pci_alloc_tag_set(struct nvme_dev *dev)
 
 	set->ops = &nvme_mq_ops;
 	set->nr_hw_queues = dev->online_queues - 1;
-	set->nr_maps = 2; /* default + read */
+	set->nr_maps = 1;
+	if (dev->io_queues[HCTX_TYPE_READ])
+		set->nr_maps = 2;
 	if (dev->io_queues[HCTX_TYPE_POLL])
-		set->nr_maps++;
+		set->nr_maps = 3;
 	set->timeout = NVME_IO_TIMEOUT;
 	set->numa_node = dev->ctrl.numa_node;
 	set->queue_depth = min_t(unsigned, dev->q_depth, BLK_MQ_MAX_DEPTH) - 1;
-- 
2.30.2



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

* Re: [PATCH] nvme-pci: report the actual number of tagset maps
  2022-09-26 21:01 [PATCH] nvme-pci: report the actual number of tagset maps Keith Busch
@ 2022-09-27  7:21 ` Christoph Hellwig
  2022-09-28  7:01 ` Sagi Grimberg
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2022-09-27  7:21 UTC (permalink / raw)
  To: Keith Busch; +Cc: linux-nvme, hch, Keith Busch

Thanks,

applied to nvme-6.1.


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

* Re: [PATCH] nvme-pci: report the actual number of tagset maps
  2022-09-26 21:01 [PATCH] nvme-pci: report the actual number of tagset maps Keith Busch
  2022-09-27  7:21 ` Christoph Hellwig
@ 2022-09-28  7:01 ` Sagi Grimberg
  1 sibling, 0 replies; 3+ messages in thread
From: Sagi Grimberg @ 2022-09-28  7:01 UTC (permalink / raw)
  To: Keith Busch, linux-nvme; +Cc: hch, Keith Busch

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>


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

end of thread, other threads:[~2022-09-28  7:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-26 21:01 [PATCH] nvme-pci: report the actual number of tagset maps Keith Busch
2022-09-27  7:21 ` Christoph Hellwig
2022-09-28  7:01 ` Sagi Grimberg

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.