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

2022-11-01 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 v4 06/10] drivers/vhost: add ioctl to increase the number of workers

2022-11-01 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 v4 02/10] drivers/vhost: use array to store workers

2022-11-01 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() this will

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

2022-11-01 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 v4 07/10] drivers/vhost: assign workers to virtqueues

2022-11-01 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 --- v4: Set vq->worker = NULL in vhost_vq_reset. This will fix both https://jira.sw.ru/browse/PSBM-14205

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

2022-11-01 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 v4 01/10] drivers/vhost: vhost-blk accelerator for virtio-blk guests

2022-11-01 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 v4 04/10] drivers/vhost: rework attaching cgroups to be worker aware

2022-11-01 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 v4 10/10] drivers/vhost: queue vhost_blk works at vq workers

2022-11-01 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 | 576k | 575k | 8vcpu, 2 kernel workers

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

2022-11-01 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 v4 05/10] drivers/vhost: rework worker creation

2022-11-01 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

Re: [Devel] [PATCH vz9 v2] ploop: port and fix the standby mode feature.

2022-11-01 Thread Alexander Atanasov
On 31.10.22 21:27, Denis V. Lunev wrote: On 10/31/22 19:12, Alexander Atanasov wrote: Initially in commit 80da9c2abac9 ("ploop: add a standby mode") a flag on the block device's request queue was added to put the queue into standby mode on EBUSY. Later on, the list with errors was extended in co

[Devel] [PATCH vz9] ploop: add device name to log messages

2022-11-01 Thread Alexander Atanasov
ploop uses pr_info/pr_err for logging but it does not print which device the message is about. Add device name to log messages to make debugging easier. Messages are in the following format: ploop: dm-47274: log message here Where 47274 is the device minor number which corresponds to /dev/mappe

Re: [Devel] [PATCH vz9 v2] ploop: port and fix the standby mode feature.

2022-11-01 Thread Konstantin Khorenko
On 01.11.2022 08:36, Alexander Atanasov wrote: On 31.10.22 21:27, Denis V. Lunev wrote: On 10/31/22 19:12, Alexander Atanasov wrote: [snip] @@ -1163,6 +1166,26 @@ static void ploop_queue_resubmit(struct pio *pio)   queue_work(ploop->wq, &ploop->worker);   } +static void ploop_check_sta

Re: [Devel] [PATCH vz9] ploop: add device name to log messages

2022-11-01 Thread Konstantin Khorenko
LGTM. BTW, the dm-qcow2 driver also has some pr_err() calls, do you plan to enhance them as well? On 01.11.2022 12:33, Alexander Atanasov wrote: ploop uses pr_info/pr_err for logging but it does not print which device the message is about. Add device name to log messages to make debugging eas

Re: [Devel] [PATCH vz9] ploop: add device name to log messages

2022-11-01 Thread Alexander Atanasov
On 1.11.22 17:29, Konstantin Khorenko wrote: LGTM. BTW, the dm-qcow2 driver also has some pr_err() calls, do you plan to enhance them as well? I will create an issue for dm-qcow2 to do the same. -- Regards, Alexander Atanasov ___ Devel mailing lis

Re: [Devel] [PATCH vz9 v2] ploop: port and fix the standby mode feature.

2022-11-01 Thread Alexander Atanasov
On 1.11.22 17:27, Konstantin Khorenko wrote: On 01.11.2022 08:36, Alexander Atanasov wrote: On 31.10.22 21:27, Denis V. Lunev wrote: On 10/31/22 19:12, Alexander Atanasov wrote: [snip] @@ -1163,6 +1166,26 @@ static void ploop_queue_resubmit(struct pio *pio)    queue_work(ploop->wq, &pl

Re: [Devel] [PATCH vz9 v2] ploop: port and fix the standby mode feature.

2022-11-01 Thread Kui Liu
-Original Message- From: Alexander Atanasov Date: Tuesday, 1 November 2022 at 11:57 PM To: Konstantin Khorenko , "Denis V. Lunev" , Devel Cc: Kui Liu , Alexey Kuznetsov Subject: Re: [PATCH vz9 v2] ploop: port and fix the standby mode feature. On 1.11.22 17:27, Konstantin Khorenk