Skip to content

Commit 0ed8810

Browse files
longlimsftmartinkpetersen
authored andcommitted
scsi: storvsc: setup 1:1 mapping between hardware queue and CPU queue
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 advertises num_present_cpus() as number of hardware queues. This will have upper layer setup 1:1 mapping between hardware queue and CPU queue and avoid unnecessary locking when issuing I/O. Link: https://lore.kernel.org/r/1567790660-48142-1-git-send-email-longli@linuxonhyperv.com Signed-off-by: Long Li <longli@microsoft.com> Reviewed-by: Michael Kelley <mikelley@microsoft.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 4b062e7 commit 0ed8810

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎drivers/scsi/storvsc_drv.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,8 +1837,7 @@ static int storvsc_probe(struct hv_device *device,
18371837
/*
18381838
* Set the number of HW queues we are supporting.
18391839
*/
1840-
if (stor_device->num_sc != 0)
1841-
host->nr_hw_queues = stor_device->num_sc + 1;
1840+
host->nr_hw_queues = num_present_cpus();
18421841

18431842
/*
18441843
* Set the error handler work queue.

0 commit comments

Comments
 (0)