diff --git a/block/blk-mq-cpumap.c b/block/blk-mq-cpumap.c index 1065d7c65fa1..9200e2aee746 100644 --- a/block/blk-mq-cpumap.c +++ b/block/blk-mq-cpumap.c @@ -81,6 +81,9 @@ int blk_mq_update_queue_map(unsigned int *map, unsigned int nr_queues) map[i] = map[first_sibling]; } + for (i = 0; i < queue; i++) + printk(KERN_ERR "cpumap %d -> %d\n", i, map[i]); + free_cpumask_var(cpus); return 0; } diff --git a/block/blk-mq.c b/block/blk-mq.c index 68929bad9a6a..1678da3505ea 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1265,12 +1265,25 @@ run_queue: blk_mq_put_ctx(data.ctx); } +static int did_warn; + /* * Default mapping to a software queue, since we use one per CPU. */ struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *q, const int cpu) { - return q->queue_hw_ctx[q->mq_map[cpu]]; + int i; + + i = q->mq_map[cpu]; + if (!i || did_warn) + return q->queue_hw_ctx[0]; + + printk(KERN_ERR "blk-mq: cpu %u got queue %u\n", cpu, i); + for_each_online_cpu(i) + printk(KERN_ERR " cpu%d -> queue index %u\n", i, q->mq_map[i]); + + did_warn = 1; + return q->queue_hw_ctx[0]; } EXPORT_SYMBOL(blk_mq_map_queue);