linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: scsi_debug: introduce module parameter of 'use_blk_mq'
@ 2018-07-02  5:06 Ming Lei
  2018-07-02 12:54 ` Christoph Hellwig
  2018-07-02 20:28 ` Douglas Gilbert
  0 siblings, 2 replies; 14+ messages in thread
From: Ming Lei @ 2018-07-02  5:06 UTC (permalink / raw)
  To: James Bottomley, linux-scsi, Martin K . Petersen
  Cc: linux-block, Ming Lei, Douglas Gilbert, Bart Van Assche,
	Jens Axboe, Omar Sandoval

With the introduced module parameter of 'use_blk_mq', it is easy
to switch between 'blk_mq' and 'non_blk_mq' by reloading scsi_debug
module, so that we can test scsi_mq/blk_mq related regressions easily.

Cc: Douglas Gilbert <dgilbert@interlog.com>
Cc: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Omar Sandoval <osandov@fb.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 drivers/scsi/scsi_debug.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 24d7496cd9e2..236cfb669df3 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -144,6 +144,7 @@ static const char *sdebug_version_date = "20180128";
 #define DEF_SUBMIT_QUEUES 1
 #define DEF_UUID_CTL 0
 #define JDELAY_OVERRIDDEN -9999
+#define DEF_USE_BLK_MQ  0
 
 #define SDEBUG_LUN_0_VAL 0
 
@@ -671,6 +672,7 @@ static bool sdebug_verbose;
 static bool have_dif_prot;
 static bool write_since_sync;
 static bool sdebug_statistics = DEF_STATISTICS;
+static bool sdebug_use_blk_mq = DEF_USE_BLK_MQ;
 
 static unsigned int sdebug_store_sectors;
 static sector_t sdebug_capacity;	/* in sectors */
@@ -4537,6 +4539,7 @@ module_param_named(vpd_use_hostno, sdebug_vpd_use_hostno, int,
 		   S_IRUGO | S_IWUSR);
 module_param_named(write_same_length, sdebug_write_same_length, int,
 		   S_IRUGO | S_IWUSR);
+module_param_named(use_blk_mq, sdebug_use_blk_mq, bool, S_IRUGO | S_IWUSR);
 
 MODULE_AUTHOR("Eric Youngdale + Douglas Gilbert");
 MODULE_DESCRIPTION("SCSI debug adapter driver");
@@ -5849,6 +5852,8 @@ static int sdebug_driver_probe(struct device *dev)
 	sdebug_driver_template.can_queue = sdebug_max_queue;
 	if (sdebug_clustering)
 		sdebug_driver_template.use_clustering = ENABLE_CLUSTERING;
+	if (sdebug_use_blk_mq)
+		sdebug_driver_template.force_blk_mq = 1;
 	hpnt = scsi_host_alloc(&sdebug_driver_template, sizeof(sdbg_host));
 	if (NULL == hpnt) {
 		pr_err("scsi_host_alloc failed\n");
-- 
2.9.5

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-07-03 15:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-02  5:06 [PATCH] scsi: scsi_debug: introduce module parameter of 'use_blk_mq' Ming Lei
2018-07-02 12:54 ` Christoph Hellwig
2018-07-02 12:56   ` Johannes Thumshirn
2018-07-02 13:03     ` Christoph Hellwig
2018-07-02 13:08       ` Johannes Thumshirn
2018-07-02 13:16       ` Ming Lei
2018-07-03  6:58       ` Hannes Reinecke
2018-07-02 13:13   ` Ming Lei
2018-07-02 13:41     ` Christoph Hellwig
2018-07-02 20:28 ` Douglas Gilbert
2018-07-02 20:37   ` Jens Axboe
2018-07-02 23:43     ` Ming Lei
2018-07-03 14:05       ` Jens Axboe
2018-07-03 15:41         ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).