qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
	qemu-block@nongnu.org, mtosatti@redhat.com,
	qemu-devel@nongnu.org, hreitz@redhat.com, pbonzini@redhat.com,
	"Nicolas Saenz Julienne" <nsaenzju@redhat.com>
Subject: Re: [RFC] thread-pool: Add option to fix the pool size
Date: Mon, 14 Feb 2022 15:09:07 +0100	[thread overview]
Message-ID: <Ygpig768ziKoGRKa@redhat.com> (raw)
In-Reply-To: <YgpU082hsgXjxOye@stefanha-x1.localdomain>

[-- Attachment #1: Type: text/plain, Size: 3454 bytes --]

Am 14.02.2022 um 14:10 hat Stefan Hajnoczi geschrieben:
> On Mon, Feb 14, 2022 at 12:38:22PM +0100, Kevin Wolf wrote:
> > Am 14.02.2022 um 11:09 hat Stefan Hajnoczi geschrieben:
> > > On Fri, Feb 11, 2022 at 12:32:57PM +0100, Kevin Wolf wrote:
> > > > Am 03.02.2022 um 15:19 hat Stefan Hajnoczi geschrieben:
> > > > > On Thu, Feb 03, 2022 at 10:56:49AM +0000, Daniel P. Berrangé wrote:
> > > > > > On Thu, Feb 03, 2022 at 10:53:07AM +0000, Stefan Hajnoczi wrote:
> > > > > > > On Wed, Feb 02, 2022 at 06:52:34PM +0100, Nicolas Saenz Julienne wrote:
> > > > > 1. A global default value that all new AioContext take. The QEMU main
> > > > >    loop's qemu_aio_context will use this and all IOThread AioContext
> > > > >    will use it (unless they have been overridden).
> > > > > 
> > > > >    I would define it on --machine because that's the "global" object for
> > > > >    a guest, but that's not very satisfying.
> > > > 
> > > > Semantically, -machine is about the virtual hardware where as iothreads
> > > > are about the backend, so I agree it's not a good fit.
> > > > 
> > > > For the main thread, you may want to configure all the same options that
> > > > you can configure for an iothread. So to me that sounds like we would
> > > > want to allow using an iothread object for the main thread, too.
> > > > 
> > > > That would still require us to tell QEMU which iothread object should be
> > > > used for the main thread, though.
> > > 
> > > Making the main loop thread an IOThread is an interesting direction but
> > > not an easy change to make.
> > > 
> > > The main loop thread has a custom event loop that is not interchangeable
> > > with the IOThread event loop:
> > > - The main loop has a poll notifier interface for libslirp fd monitoring
> > >   integration.
> > > - The main loop is a GLib event loop but manually polls to get
> > >   nanosecond resolution timers.
> > > - The main loop has icount integration.
> > > - The main loop has the special iohandler AioContext
> > > 
> > > The IOThread event loop runs an optimized AioContext event loop instead.
> > > It falls back to regular g_main_loop_run() if there is a GSource user.
> > > 
> > > It would definitely be nice to unify the main loop with IOThread and
> > > then use --object iothread,... to configure main loop parameters.
> > > 
> > > I'm not sure if requiring that of Nicolas is fair though. The event
> > > loops in QEMU are complex and changes are likely to introduce subtle
> > > bugs or performance regressions.
> > 
> > I'm not suggesting actually running the iothread event loop instead,
> > merely using the properties of an object to configure the main thread as
> > the external user interface.
> > Whether this uses the same main loop code as today or is moved to the
> > regular iothread event loop is an implementation detail that can be
> > changed later.
> > 
> > Or we could maybe use a different object type like 'mainthread' and
> > share the properties using QOM inheritance.
> 
> That seems cleaner than trying faking an IOThread to me since I don't
> see a concrete plan to unify the two event loops.
> 
> The main loop code is in util/main-loop.c. Maybe call it --object
> main-loop? Attempting to instantiate more than one main-loop object
> should fail.

Sounds good. And if you don't create one explicitly, we'll just
internally create a default main-loop object.

Kevin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-02-14 14:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-02 17:52 [RFC] thread-pool: Add option to fix the pool size Nicolas Saenz Julienne
2022-02-03 10:53 ` Stefan Hajnoczi
2022-02-03 10:56   ` Daniel P. Berrangé
2022-02-03 14:19     ` Stefan Hajnoczi
2022-02-11  9:30       ` Nicolas Saenz Julienne
2022-02-11 11:32       ` Kevin Wolf
2022-02-14 10:09         ` Stefan Hajnoczi
2022-02-14 11:38           ` Kevin Wolf
2022-02-14 13:10             ` Stefan Hajnoczi
2022-02-14 14:09               ` Kevin Wolf [this message]
2022-02-07 12:00   ` Nicolas Saenz Julienne
2022-02-07 15:20     ` Stefan Hajnoczi

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=Ygpig768ziKoGRKa@redhat.com \
    --to=kwolf@redhat.com \
    --cc=berrange@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=nsaenzju@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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 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).