scsi: storvsc: Select channel based on available percentage of ring buffer to write
authorLong Li <longli@microsoft.com>
Thu, 19 Apr 2018 21:54:24 +0000 (14:54 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 20 Apr 2018 19:38:38 +0000 (15:38 -0400)
commit2217a47de42f85b69714c2a621af13cfeae35b40
treea6fd09143ed5f3201d03b5801579f778c4f54a31
parent69589c9bb9c24499ace5158e236bed5906009efa
scsi: storvsc: Select channel based on available percentage of ring buffer to write

This is a best effort for estimating on how busy the ring buffer is for
that channel, based on available buffer to write in percentage. It is
still possible that at the time of actual ring buffer write, the space
may not be available due to other processes may be writing at the time.

Selecting a channel based on how full it is can reduce the possibility
that a ring buffer write will fail, and avoid the situation a channel is
over busy.

Now it's possible that storvsc can use a smaller ring buffer size
(e.g. 40k bytes) to take advantage of cache locality.

Signed-off-by: Long Li <longli@microsoft.com>
Reviewed-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/storvsc_drv.c