All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blk-mq: skip zero-queue maps in blk_mq_map_swqueue
@ 2018-12-17 17:28 Ming Lei
  2018-12-17 17:30 ` Christoph Hellwig
  2018-12-17 17:32 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Ming Lei @ 2018-12-17 17:28 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Ming Lei, Jeff Moyer, Mike Snitzer,
	Christoph Hellwig

From 7e849dd9cf37 ("nvme-pci: don't share queue maps"), the mapping
table won't be initialized actually if map->nr_queues is zero, so
we can't use blk_mq_map_queue_type() to retrieve hctx any more.

This way still may cause broken mapping, fix it by skipping zero-queues
maps in blk_mq_map_swqueue().

Cc: Jeff Moyer <jmoyer@redhat.com>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 block/blk-mq.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 17de117be019..8075b16c5228 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2433,6 +2433,9 @@ static void blk_mq_map_swqueue(struct request_queue *q)
 
 		ctx = per_cpu_ptr(q->queue_ctx, i);
 		for (j = 0; j < set->nr_maps; j++) {
+			if (!set->map[j].nr_queues)
+				continue;
+
 			hctx = blk_mq_map_queue_type(q, j, i);
 
 			/*
-- 
2.9.5


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

* Re: [PATCH] blk-mq: skip zero-queue maps in blk_mq_map_swqueue
  2018-12-17 17:28 [PATCH] blk-mq: skip zero-queue maps in blk_mq_map_swqueue Ming Lei
@ 2018-12-17 17:30 ` Christoph Hellwig
  2018-12-17 17:32 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2018-12-17 17:30 UTC (permalink / raw)
  To: Ming Lei
  Cc: Jens Axboe, linux-block, Jeff Moyer, Mike Snitzer,
	Christoph Hellwig

On Tue, Dec 18, 2018 at 01:28:56AM +0800, Ming Lei wrote:
> >From 7e849dd9cf37 ("nvme-pci: don't share queue maps"), the mapping
> table won't be initialized actually if map->nr_queues is zero, so
> we can't use blk_mq_map_queue_type() to retrieve hctx any more.
> 
> This way still may cause broken mapping, fix it by skipping zero-queues
> maps in blk_mq_map_swqueue().

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH] blk-mq: skip zero-queue maps in blk_mq_map_swqueue
  2018-12-17 17:28 [PATCH] blk-mq: skip zero-queue maps in blk_mq_map_swqueue Ming Lei
  2018-12-17 17:30 ` Christoph Hellwig
@ 2018-12-17 17:32 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2018-12-17 17:32 UTC (permalink / raw)
  To: Ming Lei; +Cc: linux-block, Jeff Moyer, Mike Snitzer, Christoph Hellwig

On 12/17/18 10:28 AM, Ming Lei wrote:
> From 7e849dd9cf37 ("nvme-pci: don't share queue maps"), the mapping
> table won't be initialized actually if map->nr_queues is zero, so
> we can't use blk_mq_map_queue_type() to retrieve hctx any more.
> 
> This way still may cause broken mapping, fix it by skipping zero-queues
> maps in blk_mq_map_swqueue().

Applied, thanks.

-- 
Jens Axboe


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

end of thread, other threads:[~2018-12-17 17:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-17 17:28 [PATCH] blk-mq: skip zero-queue maps in blk_mq_map_swqueue Ming Lei
2018-12-17 17:30 ` Christoph Hellwig
2018-12-17 17:32 ` Jens Axboe

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.