scsi: virtio: virtio_scsi: Set can_queue to the length of the virtqueue.
authorRichard W.M. Jones <rjones@redhat.com>
Thu, 10 Aug 2017 16:56:52 +0000 (17:56 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 25 Aug 2017 02:28:51 +0000 (22:28 -0400)
commit582b0ab200105b06704cef6da814fbde4c2ca00b
tree56ac16fe5cfd4459b34b7f7a49a8639c59e1ed7a
parent44ed8089e991a60d614abe0ee4b9057a28b364e4
scsi: virtio: virtio_scsi: Set can_queue to the length of the virtqueue.

Since switching to blk-mq as the default in commit 5c279bd9e406
("scsi: default to scsi-mq"), virtio-scsi LUNs consume about 10x as
much kernel memory.

qemu currently allocates a fixed 128 entry virtqueue.  can_queue
currently is set to 1024.  But with indirect descriptors, each command
in the queue takes 1 virtqueue entry, so the number of commands which
can be queued is equal to the length of the virtqueue.

Note I intend to send a patch to qemu to allow the virtqueue size to be
configured from the qemu command line.

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/virtio_scsi.c