Commit bffa9909 authored by Ming Lei's avatar Ming Lei Committed by Jens Axboe

blk-mq: don't keep offline CPUs mapped to hctx 0

From commit 4b855ad3 ("blk-mq: Create hctx for each present CPU),
blk-mq doesn't remap queue after CPU topo is changed, that said when
some of these offline CPUs become online, they are still mapped to
hctx 0, then hctx 0 may become the bottleneck of IO dispatch and

This patch sets up the mapping from the beginning, and aligns to
queue mapping for PCI device (blk_mq_pci_map_queues()).

Cc: Stefan Haberland <>
Cc: Keith Busch <>
Fixes: 4b855ad3 ("blk-mq: Create hctx for each present CPU)
Tested-by: default avatarChristian Borntraeger <>
Reviewed-by: default avatarChristoph Hellwig <>
Reviewed-by: default avatarSagi Grimberg <>
Signed-off-by: default avatarMing Lei <>
Signed-off-by: default avatarJens Axboe <>
parent a1c735fb
......@@ -16,11 +16,6 @@
static int cpu_to_queue_index(unsigned int nr_queues, const int cpu)
* Non present CPU will be mapped to queue index 0.
if (!cpu_present(cpu))
return 0;
return cpu % nr_queues;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment