summaryrefslogtreecommitdiff
path: root/block/blk-mq-sched.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-10-29 22:13:29 +0300
committerJens Axboe <axboe@kernel.dk>2018-11-07 23:44:59 +0300
commitf31967f0e455d08d3ea1d2f849bf62dafc92dbf4 (patch)
tree22fbc79b5ba286e2add8f995a8cfa9f211200192 /block/blk-mq-sched.c
parentf9afca4d367b8c915f28d29fcaba7460640403ff (diff)
downloadlinux-f31967f0e455d08d3ea1d2f849bf62dafc92dbf4.tar.xz
blk-mq: allow software queue to map to multiple hardware queues
The mapping used to be dependent on just the CPU location, but now it's a tuple of (type, cpu) instead. This is a prep patch for allowing a single software queue to map to multiple hardware queues. No functional changes in this patch. This changes the software queue count to an unsigned short to save a bit of space. We can still support 64K-1 CPUs, which should be enough. Add a check to catch a wrap. Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq-sched.c')
-rw-r--r--block/blk-mq-sched.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
index 68087bf71a61..bbabc3877d5a 100644
--- a/block/blk-mq-sched.c
+++ b/block/blk-mq-sched.c
@@ -109,7 +109,7 @@ static void blk_mq_do_dispatch_sched(struct blk_mq_hw_ctx *hctx)
static struct blk_mq_ctx *blk_mq_next_ctx(struct blk_mq_hw_ctx *hctx,
struct blk_mq_ctx *ctx)
{
- unsigned idx = ctx->index_hw;
+ unsigned short idx = ctx->index_hw[hctx->type];
if (++idx == hctx->nr_ctx)
idx = 0;