[Devel] [PATCH RH9 v3 07/10] drivers/vhost: assign workers to virtqueues

2022-10-10 Thread Andrey Zhadchenko
Add worker pointer to every virtqueue. Add routine to assing workers to virtqueues and call it after any worker creation https://jira.sw.ru/browse/PSBM-139414 Signed-off-by: Andrey Zhadchenko --- drivers/vhost/vhost.c | 13 + drivers/vhost/vhost.h | 2 ++ 2 files changed, 15 inserti

[Devel] [PATCH RH9 v3 05/10] drivers/vhost: rework worker creation

2022-10-10 Thread Andrey Zhadchenko
Add function to create a vhost worker and add it into the device. Rework vhost_dev_set_owner https://jira.sw.ru/browse/PSBM-139414 Signed-off-by: Andrey Zhadchenko --- drivers/vhost/vhost.c | 68 +-- 1 file changed, 40 insertions(+), 28 deletions(-) diff

[Devel] [PATCH RH9 v3 02/10] drivers/vhost: use array to store workers

2022-10-10 Thread Andrey Zhadchenko
We want to support several vhost workers. The first step is to rework vhost to use array of workers rather than single pointer. Update creation and cleanup routines. https://jira.sw.ru/browse/PSBM-139414 Signed-off-by: Andrey Zhadchenko --- v3: set vq->worker to NULL in vhost_vq_reset() drivers

[Devel] [PATCH RH9 v3 03/10] drivers/vhost: adjust vhost to flush all workers

2022-10-10 Thread Andrey Zhadchenko
Make vhost_work_dev_flush support several workers and flush them simultaneously https://jira.sw.ru/browse/PSBM-139414 Signed-off-by: Andrey Zhadchenko --- v2: - don't bother with checking dev->workers[0].worker since dev->nworkers will always contain 0 in this case drivers/vhost/vhost.c | 16 +

[Devel] [PATCH RH9 v3 00/10] vhost-blk: in-kernel accelerator for virtio-blk guests

2022-10-10 Thread Andrey Zhadchenko
Although QEMU virtio-blk is quite fast, there is still some room for improvements. Disk latency can be reduced if we handle virito-blk requests in host kernel so we avoid a lot of syscalls and context switches. The idea is quite simple - QEMU gives us block device and we translate any incoming virt

[Devel] [PATCH RH9 v3 06/10] drivers/vhost: add ioctl to increase the number of workers

2022-10-10 Thread Andrey Zhadchenko
Finally add ioctl to allow userspace to create additional workers For now only allow to increase the number of workers https://jira.sw.ru/browse/PSBM-139414 Signed-off-by: Andrey Zhadchenko --- v2: - Make code do what docs suggest. Previously ioctl-supplied new number of workers were treated lik

[Devel] [PATCH RH9 v3 09/10] drivers/vhost: allow polls to be bound to workers via vqs

2022-10-10 Thread Andrey Zhadchenko
Allow vhost polls to be associated with vqs so we can queue them on assigned workers. If polls are not associated with specific vqs queue them on the first worker. https://jira.sw.ru/browse/PSBM-139414 Signed-off-by: Andrey Zhadchenko --- drivers/vhost/vhost.c | 24 driv

[Devel] [PATCH RH9 v3 08/10] drivers/vhost: add API to queue work at virtqueue worker

2022-10-10 Thread Andrey Zhadchenko
Add routines to queue works on virtqueue assigned workers https://jira.sw.ru/browse/PSBM-139414 Signed-off-by: Andrey Zhadchenko --- drivers/vhost/vhost.c | 22 ++ drivers/vhost/vhost.h | 5 + 2 files changed, 27 insertions(+) diff --git a/drivers/vhost/vhost.c b/driver

[Devel] [PATCH RH9 v3 04/10] drivers/vhost: rework attaching cgroups to be worker aware

2022-10-10 Thread Andrey Zhadchenko
Rework vhost_attach_cgroups to manipulate specified worker. Implement vhost_worker_flush as we need to flush specific worker. https://jira.sw.ru/browse/PSBM-139414 Signed-off-by: Andrey Zhadchenko --- drivers/vhost/vhost.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-)

[Devel] [PATCH RH9 v3 01/10] drivers/vhost: vhost-blk accelerator for virtio-blk guests

2022-10-10 Thread Andrey Zhadchenko
Although QEMU virtio is quite fast, there is still some room for improvements. Disk latency can be reduced if we handle virito-blk requests in host kernel istead of passing them to QEMU. The patch adds vhost-blk kernel module to do so. Some test setups: fio --direct=1 --rw=randread --bs=4k --ioe

[Devel] [PATCH RH9 v3 10/10] drivers/vhost: queue vhost_blk works at vq workers

2022-10-10 Thread Andrey Zhadchenko
Update vhost_blk to queue works on virtqueue workers. Together with previous changes this allows us to split virtio blk requests across several threads. | randread, IOPS | randwrite, IOPS | 8vcpu, 1 kernel worker | 497k | 469k | 8vcpu, 2 kernel workers