vhost-scsi: Add support for a worker thread per virtqueue
authorMike Christie <michael.christie@oracle.com>
Mon, 4 Dec 2023 23:16:18 +0000 (17:16 -0600)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 25 Dec 2023 16:34:55 +0000 (11:34 -0500)
commit51396556f0927c3d202f9903db5aa5aa8d4cbd2c
tree81b8a164ba03c03fd111f13fcc587a60e1b727f7
parent9aad781959d770eb2479596a23e471cd82bd4e5b
vhost-scsi: Add support for a worker thread per virtqueue

This adds support for vhost-scsi to be able to create a worker thread
per virtqueue. Right now for vhost-net we get a worker thread per
tx/rx virtqueue pair which scales nicely as we add more virtqueues and
CPUs, but for scsi we get the single worker thread that's shared by all
virtqueues. When trying to send IO to more than 2 virtqueues the single
thread becomes a bottlneck.

This patch adds a new setting, worker_per_virtqueue, which can be set
to:

false: Existing behavior where we get the single worker thread.
true: Create a worker per IO virtqueue.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20231204231618.21962-3-michael.christie@oracle.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
hw/scsi/vhost-scsi.c
include/hw/virtio/virtio-scsi.h