Skip to content

Commit

Permalink
scsi: storvsc: setup 1:1 mapping between hardware queue and CPU queue
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Long Li authored and Martin K. Petersen committed Sep 24, 2019
1 parent 4b062e7 commit 0ed8810
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/scsi/storvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1837,8 +1837,7 @@ static int storvsc_probe(struct hv_device *device,
/*
* Set the number of HW queues we are supporting.
*/
if (stor_device->num_sc != 0)
host->nr_hw_queues = stor_device->num_sc + 1;
host->nr_hw_queues = num_present_cpus();

/*
* Set the error handler work queue.
Expand Down

0 comments on commit 0ed8810

Please sign in to comment.