From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Ming Lei To: Jens Axboe , linux-block@vger.kernel.org, Christoph Hellwig , Mike Snitzer Cc: linux-scsi@vger.kernel.org, Hannes Reinecke , Arun Easi , Omar Sandoval , "Martin K . Petersen" , James Bottomley , Christoph Hellwig , Don Brace , Kashyap Desai , Peter Rivera , Laurence Oberman , Ming Lei Subject: [PATCH V3 6/8] block: null_blk: introduce module parameter of 'g_host_tags' Date: Tue, 27 Feb 2018 18:07:48 +0800 Message-Id: <20180227100750.32299-7-ming.lei@redhat.com> In-Reply-To: <20180227100750.32299-1-ming.lei@redhat.com> References: <20180227100750.32299-1-ming.lei@redhat.com> List-ID: This patch introduces the parameter of 'g_host_tags' so that we can test this feature by null_blk easiy. With host_tags when the whole hw depth is kept as same, it is observed that IOPS can be improved by ~50% on a dual socket(total 16 CPU cores) system: 1) no 'host_tags', each hw queue depth is 16, and 1 hw queue modprobe null_blk queue_mode=2 nr_devices=4 shared_tags=1 host_tags=0 submit_queues=1 hw_queue_depth=16 IOPS: 1382K 2) 'host_tags', each hw queue depth is 8, and 2 hw queues modprobe null_blk queue_mode=2 nr_devices=4 shared_tags=1 host_tags=1 submit_queues=2 hw_queue_depth=16 IOPS: 2124K 3) fio test done in above two settings: fio --bs=4k --size=512G --rw=randread --norandommap --direct=1 --ioengine=libaio --iodepth=4 --runtime=$RUNTIME --group_reporting=1 --name=nullb0 --filename=/dev/nullb0 --name=nullb1 --filename=/dev/nullb1 --name=nullb2 --filename=/dev/nullb2 --name=nullb3 --filename=/dev/nullb3 Cc: Arun Easi Cc: Omar Sandoval , Cc: "Martin K. Petersen" , Cc: James Bottomley , Cc: Christoph Hellwig , Cc: Don Brace Cc: Kashyap Desai Cc: Peter Rivera Cc: Laurence Oberman Cc: Hannes Reinecke Cc: Mike Snitzer Signed-off-by: Ming Lei --- drivers/block/null_blk.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c index 287a09611c0f..51b16249028a 100644 --- a/drivers/block/null_blk.c +++ b/drivers/block/null_blk.c @@ -163,6 +163,10 @@ static int g_submit_queues = 1; module_param_named(submit_queues, g_submit_queues, int, S_IRUGO); MODULE_PARM_DESC(submit_queues, "Number of submission queues"); +static int g_host_tags = 0; +module_param_named(host_tags, g_host_tags, int, S_IRUGO); +MODULE_PARM_DESC(host_tags, "All submission queues share one tags"); + static int g_home_node = NUMA_NO_NODE; module_param_named(home_node, g_home_node, int, S_IRUGO); MODULE_PARM_DESC(home_node, "Home node for the device"); @@ -1622,6 +1626,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_host_tags) + set->flags |= BLK_MQ_F_HOST_TAGS; set->driver_data = NULL; if ((nullb && nullb->dev->blocking) || g_blocking) -- 2.9.5