path: root/block
diff options
authorMing Lei <>2021-01-22 10:33:08 +0800
committerMartin K. Petersen <>2021-03-04 17:36:59 -0500
commitc548e62bcf6adc7066ff201e9ecc88e536dd8890 (patch)
tree526fdd3f62253edc5c9512207fa76655991d7c5c /block
parentbf2c4282a10a92810ba83e85677a5273d6ca0df5 (diff)
scsi: sbitmap: Move allocation hint into sbitmap
Allocation hint should have belonged to sbitmap. Also, when sbitmap's depth is high and there is no need to use mulitple wakeup queues, user can benefit from percpu allocation hint too. Move allocation hint into sbitmap, then SCSI device queue can benefit from allocation hint when converting to plain sbitmap. Convert vhost/scsi.c to use sbitmap allocation with percpu alloc hint. This is more efficient than the previous approach. Link: Cc: Omar Sandoval <> Cc: Kashyap Desai <> Cc: Sumanesh Samanta <> Cc: Ewan D. Milne <> Cc: Mike Christie <> Cc: Tested-by: Sumanesh Samanta <> Reviewed-by: Hannes Reinecke <> Signed-off-by: Ming Lei <> Signed-off-by: Martin K. Petersen <>
Diffstat (limited to 'block')
2 files changed, 2 insertions, 2 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index f133bbfa6cd4..2e8c94e00f58 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2702,7 +2702,7 @@ blk_mq_alloc_hctx(struct request_queue *q, struct blk_mq_tag_set *set,
goto free_cpumask;
if (sbitmap_init_node(&hctx->ctx_map, nr_cpu_ids, ilog2(8),
- gfp, node, false))
+ gfp, node, false, false))
goto free_ctxs;
hctx->nr_ctx = 0;
diff --git a/block/kyber-iosched.c b/block/kyber-iosched.c
index d39ac13f0105..8969e122f081 100644
--- a/block/kyber-iosched.c
+++ b/block/kyber-iosched.c
@@ -479,7 +479,7 @@ static int kyber_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int hctx_idx)
for (i = 0; i < KYBER_NUM_DOMAINS; i++) {
if (sbitmap_init_node(&khd->kcq_map[i], hctx->nr_ctx,
ilog2(8), GFP_KERNEL, hctx->numa_node,
- false)) {
+ false, false)) {
while (--i >= 0)
goto err_kcqs;