From: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
To: Alexander Ivanov <alexander.ivanov@virtuozzo.com>,
andrey.zhadchenko@virtuozzo.com
Cc: svt-core@virtuozzo.com, Sashiko <no-reply@sashiko.virtuozzo.com>
Subject: Re: [PATCH hci-8.2 v8 6/7] vhost-blk: create kernel threads with the mainstream worker ioctls
Date: Fri, 20 Nov 2026 15:51:20 +0200 [thread overview]
Message-ID: <ccd447fc-4929-4f6f-9a4a-88a1e7fe8313@virtuozzo.com> (raw)
In-Reply-To: <20261120134744.3893196-7-alexander.ivanov@virtuozzo.com>
On 11/20/26 3:47 PM, Alexander Ivanov wrote:
> num-threads was passed to our own VHOST_SET_NWORKERS kernel ioctl. The
> kernel drops it with the revert of "drivers/vhost: add ioctl to
> increase the number of workers" in favour of the mainstream worker
> ioctls, which vhost-blk now supports. Create num-threads - 1 workers
> with VHOST_NEW_WORKER and attach them to the virtqueues round-robin
> with VHOST_ATTACH_VRING_WORKER, the layout VHOST_SET_NWORKERS produced.
> num-threads of 0 still means one thread and a value above num-queues
> is clamped to it, as VHOST_SET_NWORKERS did.
>
> Our kernel, unlike mainline, defaults to kthread mode, where
> VHOST_NEW_WORKER fails with -EFAULT rather than -ENOTTY. So switch the
> device to vhost_task mode with VHOST_SET_FORK_FROM_OWNER before
> VHOST_SET_OWNER. Do it for num-threads=1 as well, so the default
> thread is of the same kind whatever the number of workers, but only
> warn when it fails there: a single thread works in either mode. A kernel
> without the ioctl fails it with -EPERM from the owner check rather
> than -ENOTTY, so the error code cannot tell it apart.
>
> Fail to start vhost-blk if any of the worker ioctls fails rather than
> silently run on fewer threads than requested. num-threads above 1 now
> requires a kernel whose vhost-blk handles them.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-107537
>
> Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
> Reviewed-by: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
> Reviewed-by: Sashiko <no-reply@sashiko.virtuozzo.com>
> ---
> [...]
Reviewed-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
next prev parent reply other threads:[~2026-11-20 13:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 13:47 [PATCH hci-8.2 v8 0/7] vhost-blk: switch from VHOST_SET_NWORKERS to " Alexander Ivanov
2026-11-20 13:47 ` [PATCH hci-8.2 v8 1/7] vhost-backend: add vhost_set_fork_from_owner op Alexander Ivanov
2026-11-20 13:47 ` [PATCH hci-8.2 v8 2/7] vhost-blk: reject num-queues above VHOST_BLK_MAX_QUEUES Alexander Ivanov
2026-11-20 13:47 ` [PATCH hci-8.2 v8 3/7] vhost-blk: use a local vhost_dev pointer in start and stop Alexander Ivanov
2026-11-20 13:47 ` [PATCH hci-8.2 v8 4/7] vhost-blk: fix vhost_blk_start() returning 0 on failure Alexander Ivanov
2026-11-20 13:47 ` [PATCH hci-8.2 v8 5/7] vhost-blk: reset the owner when vhost_blk_start() fails Alexander Ivanov
2026-11-20 13:47 ` [PATCH hci-8.2 v8 6/7] vhost-blk: create kernel threads with the mainstream worker ioctls Alexander Ivanov
2026-11-20 13:51 ` Andrey Drobyshev [this message]
2026-11-20 13:47 ` [PATCH hci-8.2 v8 7/7] linux-headers: drop VHOST_SET_NWORKERS Alexander Ivanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ccd447fc-4929-4f6f-9a4a-88a1e7fe8313@virtuozzo.com \
--to=andrey.drobyshev@virtuozzo.com \
--cc=alexander.ivanov@virtuozzo.com \
--cc=andrey.zhadchenko@virtuozzo.com \
--cc=no-reply@sashiko.virtuozzo.com \
--cc=svt-core@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.