Re: [PATCH v2.5 3/6] scsi_debug: add multiple queue support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux