Skip to content

Commit

Permalink
scsi: storvsc: Spread interrupts when picking a channel for I/O requests
Browse files Browse the repository at this point in the history
Update the algorithm in storvsc_do_io to look for a channel
starting with the current CPU + 1 and wrap around (within the
current NUMA node). This spreads VMbus interrupts more evenly
across CPUs. Previous code always started with first CPU in
the current NUMA node, skewing the interrupt load to that CPU.

Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Michael Kelley (EOSG) authored and Martin K. Petersen committed Feb 22, 2018
1 parent 9ff97fa commit 9cfad4a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/scsi/storvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,8 @@ static int storvsc_do_io(struct hv_device *device,
*/
cpumask_and(&alloced_mask, &stor_device->alloced_cpus,
cpumask_of_node(cpu_to_node(q_num)));
for_each_cpu(tgt_cpu, &alloced_mask) {
for_each_cpu_wrap(tgt_cpu, &alloced_mask,
outgoing_channel->target_cpu + 1) {
if (tgt_cpu != outgoing_channel->target_cpu) {
outgoing_channel =
stor_device->stor_chns[tgt_cpu];
Expand Down

0 comments on commit 9cfad4a

Please sign in to comment.