[PATCH 1/4] nvme-pci: correct mapping for poll queue(s)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If we don't have poll queue, its mapping should share default type's,
instead of setting up one new mapping via blk_mq_map_queues().

blk_mq_map_swqueue() is actually fragile to deal with shared mapping, then
one same ctx can be mapped to two hctxes with same queue type, this
way may cause IO hang easily.

Cc: Jeff Moyer <jmoyer@xxxxxxxxxx>
Cc: Mike Snitzer <snitzer@xxxxxxxxxx>
Cc: Christoph Hellwig <hch@xxxxxx>
Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx>
---
 drivers/nvme/host/pci.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index fb9d8270f32c..95bd68be2078 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -505,10 +505,11 @@ static int nvme_pci_map_queues(struct blk_mq_tag_set *set)
 
 		/*
 		 * The poll queue(s) doesn't have an IRQ (and hence IRQ
-		 * affinity), so use the regular blk-mq cpu mapping
+		 * affinity), so use the regular blk-mq cpu mapping if
+		 * poll queue(s) don't share mapping with TYPE_DEFAULT.
 		 */
 		map->queue_offset = qoff;
-		if (i != HCTX_TYPE_POLL)
+		if (i != HCTX_TYPE_POLL || !qoff)
 			blk_mq_pci_map_queues(map, to_pci_dev(dev->dev), offset);
 		else
 			blk_mq_map_queues(map);
-- 
2.9.5




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux