netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cindy Lu <lulu@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: nicolas.dichtel@6wind.com, mst@redhat.com,
	michael.christie@oracle.com,  sgarzare@redhat.com,
	linux-kernel@vger.kernel.org,
	 virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH v12 1/1] vhost: Reintroduces support of kthread API and adds mode selection
Date: Fri, 11 Jul 2025 14:48:12 +0800	[thread overview]
Message-ID: <CACLfguWqF62MMY3Y45GCRnh=5J75q6ebAqhFgOmhsAAsoyYXew@mail.gmail.com> (raw)
In-Reply-To: <CACGkMEsJdfeNuHdKu0OH=sT4RYhN3d_VOnDcu4_-FquRXo24Xw@mail.gmail.com>

On Thu, Jun 19, 2025 at 9:02 AM Jason Wang <jasowang@redhat.com> wrote:
>
> On Wed, Jun 18, 2025 at 8:06 PM Nicolas Dichtel
> <nicolas.dichtel@6wind.com> wrote:
> >
> > Le 16/06/2025 à 08:28, Cindy Lu a écrit :
> > > This patch reintroduces kthread mode for vhost workers and provides
> > > configuration to select between kthread and task worker.
> > >
> > > - Add 'fork_owner' parameter to vhost_dev to let users select kthread
> > >   or task mode. Default mode is task mode(VHOST_FORK_OWNER_TASK).
> > >
> > > - Reintroduce kthread mode support:
> > >   * Bring back the original vhost_worker() implementation,
> > >     and renamed to vhost_run_work_kthread_list().
> > >   * Add cgroup support for the kthread
> > >   * Introduce struct vhost_worker_ops:
> > >     - Encapsulates create / stop / wake‑up callbacks.
> > >     - vhost_worker_create() selects the proper ops according to
> > >       inherit_owner.
> > >
> > > - Userspace configuration interface:
> > >   * New IOCTLs:
> > >       - VHOST_SET_FORK_FROM_OWNER lets userspace select task mode
> > >         (VHOST_FORK_OWNER_TASK) or kthread mode (VHOST_FORK_OWNER_KTHREAD)
> > >       - VHOST_GET_FORK_FROM_OWNER reads the current worker mode
> > >   * Expose module parameter 'fork_from_owner_default' to allow system
> > >     administrators to configure the default mode for vhost workers
> > >   * Kconfig option CONFIG_VHOST_ENABLE_FORK_OWNER_CONTROL controls whether
> > >     these IOCTLs and the parameter are available (for distros that may
> > >     want to disable them)
> > >
> > > - The VHOST_NEW_WORKER functionality requires fork_owner to be set
> > >   to true, with validation added to ensure proper configuration
> > >
> > > This partially reverts or improves upon:
> > >   commit 6e890c5d5021 ("vhost: use vhost_tasks for worker threads")
> > >   commit 1cdaafa1b8b4 ("vhost: replace single worker pointer with xarray")
> > >
> > > Signed-off-by: Cindy Lu <lulu@redhat.com>
> > > ---
> > >  drivers/vhost/Kconfig      |  17 +++
> > >  drivers/vhost/vhost.c      | 244 ++++++++++++++++++++++++++++++++++---
> > >  drivers/vhost/vhost.h      |  22 ++++
> > >  include/uapi/linux/vhost.h |  29 +++++
> > >  4 files changed, 294 insertions(+), 18 deletions(-)
> > >
> > > diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig
> > > index 020d4fbb947c..1b3602b1f8e2 100644
> > > --- a/drivers/vhost/Kconfig
> > > +++ b/drivers/vhost/Kconfig
> > > @@ -95,4 +95,21 @@ config VHOST_CROSS_ENDIAN_LEGACY
> > >
> > >         If unsure, say "N".
> > >
> > > +config VHOST_ENABLE_FORK_OWNER_CONTROL
> > > +     bool "Enable VHOST_ENABLE_FORK_OWNER_CONTROL"
> > > +     default n
> > Why disabling this option by default?
>
> I think we should enable this by default.
>
> Thanks
>
Thanks jason,  I will send  a new version
Thanks
cindy
> >
> > Regards,
> > Nicolas
> >
>


  reply	other threads:[~2025-07-11  6:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-16  6:28 [PATCH v12 0/1] vhost: Add support of kthread API Cindy Lu
2025-06-16  6:28 ` [PATCH v12 1/1] vhost: Reintroduces support of kthread API and adds mode selection Cindy Lu
2025-06-18 12:06   ` Nicolas Dichtel
2025-06-19  1:02     ` Jason Wang
2025-07-11  6:48       ` Cindy Lu [this message]
2025-06-24  3:06 ` [PATCH v12 0/1] vhost: Add support of kthread API Lei Yang

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='CACLfguWqF62MMY3Y45GCRnh=5J75q6ebAqhFgOmhsAAsoyYXew@mail.gmail.com' \
    --to=lulu@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.christie@oracle.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=sgarzare@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).