Thread (3 messages) 3 messages, 3 authors, 2019-08-22

RE: [PATCH] storvsc: setup 1:1 mapping between hardware queue and CPU queue

From: Long Li <longli@microsoft.com>
Date: 2019-08-22 19:32:32
Also in: linux-scsi, lkml

quoted
quoted
Subject: Re: [PATCH] storvsc: setup 1:1 mapping between hardware queue
and CPU queue

On Tue, Aug 20, 2019 at 3:36 AM [off-list ref] wrote:
quoted
From: Long Li <longli@microsoft.com>

storvsc doesn't use a dedicated hardware queue for a given CPU queue.
When issuing I/O, it selects returning CPU (hardware queue)
dynamically based on vmbus channel usage across all channels.

This patch sets up a 1:1 mapping between hardware queue and CPU
queue,
quoted
thus avoiding unnecessary locking at upper layer when issuing I/O.

Signed-off-by: Long Li <longli@microsoft.com>
---
 drivers/scsi/storvsc_drv.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index b89269120a2d..26c16d40ec46 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1682,6 +1682,18 @@ static int storvsc_queuecommand(struct
Scsi_Host *host, struct scsi_cmnd *scmnd)
quoted
        return 0;
 }

+static int storvsc_map_queues(struct Scsi_Host *shost) {
+       unsigned int cpu;
+       struct blk_mq_queue_map *qmap =
+&shost->tag_set.map[HCTX_TYPE_DEFAULT];
+
+       for_each_possible_cpu(cpu) {
+               qmap->mq_map[cpu] = cpu;
+       }
Block layer provides the helper of blk_mq_map_queues(), so suggest you
to use the default cpu mapping, instead of inventing a new one.
Thanks for the pointer. I'm sending a v2.

Long
quoted
quoted
thanks,
Ming Lei
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help