[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1597850436-116171-12-git-send-email-john.garry@huawei.com>
Date: Wed, 19 Aug 2020 23:20:29 +0800
From: John Garry <john.garry@...wei.com>
To: <axboe@...nel.dk>, <jejb@...ux.ibm.com>,
<martin.petersen@...cle.com>, <don.brace@...rosemi.com>,
<kashyap.desai@...adcom.com>, <ming.lei@...hat.com>,
<bvanassche@....org>, <dgilbert@...erlog.com>,
<paolo.valente@...aro.org>, <hare@...e.de>, <hch@....de>
CC: <sumit.saxena@...adcom.com>, <linux-block@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-scsi@...r.kernel.org>,
<esc.storagedev@...rosemi.com>, <megaraidlinux.pdl@...adcom.com>,
<chenxiang66@...ilicon.com>, <luojiaxing@...wei.com>,
John Garry <john.garry@...wei.com>
Subject: [PATCH v8 11/18] null_blk: Support shared tag bitmap
Support a shared tag bitmap, whereby request tags are unique over all
submission queues, and not just per submission queue.
As such, per device total queue depth is normally hw_queue_depth *
submit_queues, but hw_queue_depth when set. And a similar story for when
shared_tags is set, where that is the queue depth over all null blk
devices.
Signed-off-by: John Garry <john.garry@...wei.com>
---
drivers/block/null_blk_main.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/block/null_blk_main.c b/drivers/block/null_blk_main.c
index 47a9dad880af..19c04e074880 100644
--- a/drivers/block/null_blk_main.c
+++ b/drivers/block/null_blk_main.c
@@ -164,6 +164,10 @@ static bool shared_tags;
module_param(shared_tags, bool, 0444);
MODULE_PARM_DESC(shared_tags, "Share tag set between devices for blk-mq");
+static bool g_shared_tag_bitmap;
+module_param_named(shared_tag_bitmap, g_shared_tag_bitmap, bool, 0444);
+MODULE_PARM_DESC(shared_tag_bitmap, "Use shared tag bitmap for all submission queues for blk-mq");
+
static int g_irqmode = NULL_IRQ_SOFTIRQ;
static int null_set_irqmode(const char *str, const struct kernel_param *kp)
@@ -1692,6 +1696,8 @@ static int null_init_tag_set(struct nullb *nullb, struct blk_mq_tag_set *set)
set->flags = BLK_MQ_F_SHOULD_MERGE;
if (g_no_sched)
set->flags |= BLK_MQ_F_NO_SCHED;
+ if (g_shared_tag_bitmap)
+ set->flags |= BLK_MQ_F_TAG_HCTX_SHARED;
set->driver_data = NULL;
if ((nullb && nullb->dev->blocking) || g_blocking)
--
2.26.2
Powered by blists - more mailing lists