Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH] scsi_debug: Use scsi-mq if it has been enabled
@ 2018-01-24  0:39 Bart Van Assche
  2018-01-24  6:29 ` Douglas Gilbert
  2018-01-26  7:58 ` Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: Bart Van Assche @ 2018-01-24  0:39 UTC (permalink / raw)
  To: Martin K . Petersen, James E . J . Bottomley
  Cc: linux-scsi, Bart Van Assche, Douglas Gilbert, Hannes Reinecke,
	Christoph Hellwig

Since we want to remove the single queue code from the SCSI core
at the appropriate time and since scsi-mq performs better than
scsi-sq even when using only a single hardware queue, use scsi-mq
if it has been enabled.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Douglas Gilbert <dgilbert@interlog.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
---
 drivers/scsi/scsi_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index a5986dae9020..40df3eea72c8 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -5782,7 +5782,7 @@ static int sdebug_driver_probe(struct device * dev)
 	}
 	/* Decide whether to tell scsi subsystem that we want mq */
 	/* Following should give the same answer for each host */
-	sdebug_mq_active = shost_use_blk_mq(hpnt) && (submit_queues > 1);
+	sdebug_mq_active = shost_use_blk_mq(hpnt);
 	if (sdebug_mq_active)
 		hpnt->nr_hw_queues = submit_queues;
 
-- 
2.15.1

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

* Re: [PATCH] scsi_debug: Use scsi-mq if it has been enabled
  2018-01-24  0:39 [PATCH] scsi_debug: Use scsi-mq if it has been enabled Bart Van Assche
@ 2018-01-24  6:29 ` Douglas Gilbert
  2018-01-26  7:58 ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Douglas Gilbert @ 2018-01-24  6:29 UTC (permalink / raw)
  To: Bart Van Assche, Martin K . Petersen, James E . J . Bottomley
  Cc: linux-scsi, Hannes Reinecke, Christoph Hellwig

On 2018-01-23 07:39 PM, Bart Van Assche wrote:
> Since we want to remove the single queue code from the SCSI core
> at the appropriate time and since scsi-mq performs better than
> scsi-sq even when using only a single hardware queue, use scsi-mq
> if it has been enabled.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: Douglas Gilbert <dgilbert@interlog.com>
> Cc: Hannes Reinecke <hare@suse.com>
> Cc: Christoph Hellwig <hch@lst.de>

Acked: Douglas Gilbert <dgilbert@interlog.com>

> ---
>   drivers/scsi/scsi_debug.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
> index a5986dae9020..40df3eea72c8 100644
> --- a/drivers/scsi/scsi_debug.c
> +++ b/drivers/scsi/scsi_debug.c
> @@ -5782,7 +5782,7 @@ static int sdebug_driver_probe(struct device * dev)
>   	}
>   	/* Decide whether to tell scsi subsystem that we want mq */
>   	/* Following should give the same answer for each host */
> -	sdebug_mq_active = shost_use_blk_mq(hpnt) && (submit_queues > 1);
> +	sdebug_mq_active = shost_use_blk_mq(hpnt);
>   	if (sdebug_mq_active)
>   		hpnt->nr_hw_queues = submit_queues;
>   
> 

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

* Re: [PATCH] scsi_debug: Use scsi-mq if it has been enabled
  2018-01-24  0:39 [PATCH] scsi_debug: Use scsi-mq if it has been enabled Bart Van Assche
  2018-01-24  6:29 ` Douglas Gilbert
@ 2018-01-26  7:58 ` Christoph Hellwig
  2018-01-26 16:10   ` Bart Van Assche
  1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2018-01-26  7:58 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Martin K . Petersen, James E . J . Bottomley, linux-scsi,
	Douglas Gilbert, Hannes Reinecke, Christoph Hellwig

On Tue, Jan 23, 2018 at 04:39:58PM -0800, Bart Van Assche wrote:
> Since we want to remove the single queue code from the SCSI core
> at the appropriate time and since scsi-mq performs better than
> scsi-sq even when using only a single hardware queue, use scsi-mq
> if it has been enabled.

scsi_debug already always uses scsi-mq if enabled.  The somewhat
misnamed sdebug_mq_active variable is only used for decoding
multiqueue tags.  That being said the blk_mq_unique_tag* helpers
should be safe to use even without blk-mq, so the variable could
probably just be removed entirely.

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

* Re: [PATCH] scsi_debug: Use scsi-mq if it has been enabled
  2018-01-26  7:58 ` Christoph Hellwig
@ 2018-01-26 16:10   ` Bart Van Assche
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2018-01-26 16:10 UTC (permalink / raw)
  To: hch@lst.de
  Cc: jejb@linux.vnet.ibm.com, linux-scsi@vger.kernel.org,
	dgilbert@interlog.com, hare@suse.com, martin.petersen@oracle.com

On Fri, 2018-01-26 at 08:58 +0100, Christoph Hellwig wrote:
> scsi_debug already always uses scsi-mq if enabled.  The somewhat
> misnamed sdebug_mq_active variable is only used for decoding
> multiqueue tags.  That being said the blk_mq_unique_tag* helpers
> should be safe to use even without blk-mq, so the variable could
> probably just be removed entirely.

Hello Christoph,

Removing sdebug_mq_active sounds like a good idea to me. I will rework this
patch.

Bart.

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

end of thread, other threads:[~2018-01-26 16:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-24  0:39 [PATCH] scsi_debug: Use scsi-mq if it has been enabled Bart Van Assche
2018-01-24  6:29 ` Douglas Gilbert
2018-01-26  7:58 ` Christoph Hellwig
2018-01-26 16:10   ` Bart Van Assche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox