linux-stable/drivers/vhost
Mike Christie c1ecd8e950 vhost: allow userspace to create workers
For vhost-scsi with 3 vqs or more and a workload that tries to use
them in parallel like:

fio --filename=/dev/sdb  --direct=1 --rw=randrw --bs=4k \
--ioengine=libaio --iodepth=128  --numjobs=3

the single vhost worker thread will become a bottlneck and we are stuck
at around 500K IOPs no matter how many jobs, virtqueues, and CPUs are
used.

To better utilize virtqueues and available CPUs, this patch allows
userspace to create workers and bind them to vqs. You can have N workers
per dev and also share N workers with M vqs on that dev.

This patch adds the interface related code and the next patch will hook
vhost-scsi into it. The patches do not try to hook net and vsock into
the interface because:

1. multiple workers don't seem to help vsock. The problem is that with
only 2 virtqueues we never fully use the existing worker when doing
bidirectional tests. This seems to match vhost-scsi where we don't see
the worker as a bottleneck until 3 virtqueues are used.

2. net already has a way to use multiple workers.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
Message-Id: <20230626232307.97930-16-michael.christie@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-07-03 12:15:14 -04:00
..
iotlb.c vhost_iotlb: split out IOTLB initialization 2022-05-31 12:44:28 -04:00
Kconfig vhost_task: Allow vhost layer to use copy_process 2023-03-23 12:45:36 +01:00
Makefile vhost: introduce vDPA-based backend 2020-04-02 10:41:40 -04:00
net.c vhost: convert poll work to be vq based 2023-07-03 12:15:13 -04:00
scsi.c vhost_scsi: flush IO vqs then send TMF rsp 2023-07-03 12:15:14 -04:00
test.c vhost-test: remove meaningless debug info 2023-02-20 19:26:58 -05:00
test.h tools/virtio: Add --reset 2020-06-22 12:34:21 -04:00
vdpa.c vhost_vdpa: support PACKED when setting-getting vring_base 2023-06-09 12:08:04 -04:00
vhost.c vhost: allow userspace to create workers 2023-07-03 12:15:14 -04:00
vhost.h vhost: allow userspace to create workers 2023-07-03 12:15:14 -04:00
vringh.c vringh: support VA with iotlb 2023-04-21 03:02:33 -04:00
vsock.c vhost_sock: convert to vhost_vq_work_queue 2023-07-03 12:15:13 -04:00