]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit7e1ccee31b7bc6d5e934307b9c5d7d3f623d9dfb
tree56ac16fe5cfd4459b34b7f7a49a8639c59e1ed7a
parentf972dedf903c6cb3eb5c8b0309794ebacce4b389
scsi: virtio: virtio_scsi: Set can_queue to the length of the virtqueue.

Since switching to blk-mq as the default in commit 7e0f92cb03fa
("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