On Mon, Dec 17, 2018 at 06:42:46PM +0800, Ming Lei wrote: > From: Christoph Hellwig <hch@xxxxxx> > > Even though poll_queues are zero, nvme's mapping for HCTX_TYPE_POLL still > may be setup via blk_mq_map_queues() which cause different mapping compared > with HCTX_TYPE_DEFAULT's mapping built from managed irq affinity. > > This mapping will cause hctx->type to be over-written in blk_mq_map_swqueue(), > then the whole mapping may become broken, for example, one same ctx can be > mapped to different hctxs with same hctx type. This bad mapping has caused > IO hang in simple dd test, as reported by Mike. > > This patch sets map->nr_queues as zero explictly if there is zero > queues for such queue type, also maps to correct hctx if .nr_queues of the > queue type is zero. > > Cc: Jeff Moyer <jmoyer@xxxxxxxxxx> > Cc: Mike Snitzer <snitzer@xxxxxxxxxx> > Cc: Christoph Hellwig <hch@xxxxxx> > > (don't handle zero .nr_queues map in blk_mq_map_swqueue()) > Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx> I actually think we should split this into three patches: 1) skip zero-queue maps in blk_mq_map_swqueue 2) skip zero-queue maps in blk_mq_map_queue 3) don't duplicate maps in nvme sorry for misleading you with my quick WIP patch. I can send send patches for my two with a proper changelogs, but I'll leave blk_mq_map_swqueue to you as I don't full understand the rationale, even if it looks sensible to me.