Re: [PATCH RESEND v10 1/3] vhost: Add a new modparam to allow userspace select kthread
From: Simon Horman <horms@kernel.org>
Date: 2025-06-03 07:34:27
Also in:
lkml, virtualization
From: Simon Horman <horms@kernel.org>
Date: 2025-06-03 07:34:27
Also in:
lkml, virtualization
On Sat, May 31, 2025 at 05:57:26PM +0800, Cindy Lu wrote:
The vhost now uses vhost_task and workers as a child of the owner thread. While this aligns with containerization principles, it confuses some legacy userspace applications, therefore, we are reintroducing kthread API support. Add a new module parameter to allow userspace to select behavior between using kthread and task. By default, this parameter is set to true (task mode). This means the default behavior remains unchanged by this patch. Signed-off-by: Cindy Lu <redacted> --- drivers/vhost/vhost.c | 5 +++++ drivers/vhost/vhost.h | 10 ++++++++++ 2 files changed, 15 insertions(+)diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 3a5ebb973dba..240ba78b1e3f 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c@@ -41,6 +41,10 @@ static int max_iotlb_entries = 2048; module_param(max_iotlb_entries, int, 0444); MODULE_PARM_DESC(max_iotlb_entries, "Maximum number of iotlb entries. (default: 2048)"); +bool inherit_owner_default = true;
Hi Cindy, I don't mean to block progress of this patchset. But it looks like inherit_owner_default can be static. Flagged by Sparse.
+module_param(inherit_owner_default, bool, 0444); +MODULE_PARM_DESC(inherit_owner_default, + "Set task mode as the default(default: Y)");
...