]> git.baikalelectronics.ru Git - kernel.git/commit
vhost scsi: alloc cmds per vq instead of session
authorMike Christie <michael.christie@oracle.com>
Tue, 10 Nov 2020 05:33:20 +0000 (23:33 -0600)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 15 Nov 2020 22:30:55 +0000 (17:30 -0500)
commit6be5cb097bfcc76c4ff3c2a0eecc77ec4b438632
tree4131375a8c84042a75c7b86efbe9c5ec604b5d5c
parent31fb3c4cab0a06f3177c3542fbe3fb32e3ae4c16
vhost scsi: alloc cmds per vq instead of session

We currently are limited to 256 cmds per session. This leads to problems
where if the user has increased virtqueue_size to more than 2 or
cmd_per_lun to more than 256 vhost_scsi_get_tag can fail and the guest
will get IO errors.

This patch moves the cmd allocation to per vq so we can easily match
whatever the user has specified for num_queues and
virtqueue_size/cmd_per_lun. It also makes it easier to control how much
memory we preallocate. For cases, where perf is not as important and
we can use the current defaults (1 vq and 128 cmds per vq) memory use
from preallocate cmds is cut in half. For cases, where we are willing
to use more memory for higher perf, cmd mem use will now increase as
the num queues and queue depth increases.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
Link: https://lore.kernel.org/r/1604986403-4931-3-git-send-email-michael.christie@oracle.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Maurizio Lombardi <mlombard@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
drivers/vhost/scsi.c