All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bart.vanassche@sandisk.com>
To: Douglas Gilbert <dgilbert@interlog.com>, linux-scsi@vger.kernel.org
Cc: martin.petersen@oracle.com, tomas.winkler@intel.com,
	emilne@redhat.com, bart.vanassche@sandisk.com
Subject: Re: [PATCH v2.5 3/6] scsi_debug: add multiple queue support
Date: Wed, 4 May 2016 15:32:40 -0700	[thread overview]
Message-ID: <572A7888.6000804@sandisk.com> (raw)
In-Reply-To: <1462070687-12689-4-git-send-email-dgilbert@interlog.com>

On 04/30/2016 07:44 PM, Douglas Gilbert wrote:
> +static struct sdebug_queue *get_queue(void)
> +{
> +	struct sdebug_queue *sqp = sdebug_q_arr;
> +
> +	return sqp + (raw_smp_processor_id() % submit_queues);
> +}

Does this function have the same purpose as blk_mq_map_queue()? If so, 
why has this function been introduced instead of using blk_mq_map_queue()?

> @@ -5001,6 +5158,10 @@ static int scsi_debug_queuecommand(struct Scsi_Host *shost,
>   	bool has_wlun_rl;
>
>   	scsi_set_resid(scp, 0);
> +	if (sdebug_statistics) {
> +		sqp = get_queue();
> +		atomic_inc(&sqp->cmnd_count);
> +	}

Why does scsi_debug_queuecommand() call get_queue() instead of 
blk_mq_unique_tag() and blk_mq_unique_tag_to_hwq() which is what other 
scsi-mq drivers do?

Is the role of the sqp->cmnd_count counter identical to that of 
blk_mq_hw_ctx.queued? If so, can sqp->cmnd_count be left out and can 
blk_mq_hw_ctx.queued be used instead?

> @@ -5168,6 +5328,16 @@ static int sdebug_driver_probe(struct device * dev)
> +	if (sdebug_mq_available && (submit_queues > 1))
> +		hpnt->nr_hw_queues = submit_queues;

There is already a submit_queues < 1 check in scsi_debug_init(). Is the 
submit_queues > 1 check in sdebug_driver_probe() needed?

Bart.

  parent reply	other threads:[~2016-05-04 22:32 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-01  2:44 [PATCH v2.5 0/6] scsi_debug: rebase second half of series Douglas Gilbert
2016-05-01  2:44 ` [PATCH v2.5 1/6] scsi_debug: use pdt constants Douglas Gilbert
2016-05-02  8:25   ` Hannes Reinecke
2016-05-03 23:56   ` Bart Van Assche
2016-05-01  2:44 ` [PATCH v2.5 2/6] scsi_debug: rework resp_report_luns Douglas Gilbert
2016-05-02  8:25   ` Hannes Reinecke
2016-05-02  8:29     ` Winkler, Tomas
2016-05-03 23:58   ` Bart Van Assche
2016-05-01  2:44 ` [PATCH v2.5 3/6] scsi_debug: add multiple queue support Douglas Gilbert
2016-05-02  8:35   ` Hannes Reinecke
2016-05-02 15:35     ` Douglas Gilbert
2016-05-04 22:09     ` Bart Van Assche
2016-05-04 22:32   ` Bart Van Assche [this message]
2016-05-06  3:47     ` Douglas Gilbert
2016-05-06  4:20       ` Bart Van Assche
2016-05-01  2:44 ` [PATCH v2.5 4/6] scsi_debug: vpd and mode page work Douglas Gilbert
2016-05-02  8:38   ` Hannes Reinecke
2016-05-02 15:48     ` Douglas Gilbert
2016-05-01  2:44 ` [PATCH v2.5 5/6] scsi_debug: uuid for lu name Douglas Gilbert
2016-05-02  8:38   ` Hannes Reinecke
2016-05-04 22:37   ` Bart Van Assche
2016-05-01  2:44 ` [PATCH v2.5 6/6] scsi_debug: use locally assigned naa Douglas Gilbert
2016-05-02  8:39   ` Hannes Reinecke
2016-05-04 22:37   ` Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=572A7888.6000804@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=dgilbert@interlog.com \
    --cc=emilne@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=tomas.winkler@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.