qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Saenz Julienne <nsaenzju@redhat.com>
To: kwolf@redhat.com, stefanha@redhat.com, berrange@redhat.com
Cc: fam@euphon.net, eduardo@habkost.net, qemu-block@nongnu.org,
	michael.roth@amd.com, mtosatti@redhat.com, qemu-devel@nongnu.org,
	armbru@redhat.com, hreitz@redhat.com, pbonzini@redhat.com,
	Nicolas Saenz Julienne <nsaenzju@redhat.com>,
	eblake@redhat.com
Subject: [PATCH v3 0/3] util/thread-pool: Expose minimun and maximum size
Date: Wed, 16 Mar 2022 14:53:20 +0100	[thread overview]
Message-ID: <20220316135321.142850-1-nsaenzju@redhat.com> (raw)

As discussed on the previous RFC[1] the thread-pool's dynamic thread
management doesn't play well with real-time and latency sensitive
systems. This series introduces a set of controls that'll permit
achieving more deterministic behaviours, for example by fixing the
pool's size.

We first introduce a new common interface to event loop configuration by
moving iothread's already available properties into an abstract class
called 'EventLooopBackend' and have both 'IOThread' and the newly
created 'MainLoop' inherit the properties from that class.

With this new configuration interface in place it's relatively simple to
introduce new options to fix the even loop's thread pool sizes. The
resulting QAPI looks like this:

    -object main-loop,id=main-loop,thread-pool-min=1,thread-pool-max=1

Note that all patches are bisect friendly and pass all the tests.

[1] https://patchwork.ozlabs.org/project/qemu-devel/patch/20220202175234.656711-1-nsaenzju@redhat.com/

---
Changes since v2:
 - Get rid of wrong locking/waiting
 - Fix qapi versioning
 - Better commit messages

Changes since v1:
 - Address all Stefan's comments
 - Introduce new fix

Nicolas Saenz Julienne (3):
  Introduce event-loop-base abstract class
  util/main-loop: Introduce the main loop into QOM
  util/event-loop-base: Introduce options to set the thread pool size

 event-loop-base.c                | 140 +++++++++++++++++++++++++++++++
 include/block/aio.h              |  10 +++
 include/block/thread-pool.h      |   3 +
 include/qemu/main-loop.h         |  10 +++
 include/sysemu/event-loop-base.h |  41 +++++++++
 include/sysemu/iothread.h        |   6 +-
 iothread.c                       |  68 +++++----------
 meson.build                      |  26 +++---
 qapi/qom.json                    |  34 +++++++-
 util/aio-posix.c                 |   1 +
 util/async.c                     |  20 +++++
 util/main-loop.c                 |  65 ++++++++++++++
 util/thread-pool.c               |  55 +++++++++++-
 13 files changed, 414 insertions(+), 65 deletions(-)
 create mode 100644 event-loop-base.c
 create mode 100644 include/sysemu/event-loop-base.h

-- 
2.35.1



             reply	other threads:[~2022-03-16 14:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16 13:53 Nicolas Saenz Julienne [this message]
2022-03-16 13:53 ` [PATCH v3 1/3] Introduce event-loop-base abstract class Nicolas Saenz Julienne
2022-03-16 13:53 ` [PATCH v3 2/3] util/main-loop: Introduce the main loop into QOM Nicolas Saenz Julienne
2022-03-16 14:28   ` Markus Armbruster
2022-03-29 11:30     ` Nicolas Saenz Julienne
2022-03-16 13:53 ` [PATCH v3 3/3] util/event-loop-base: Introduce options to set the thread pool size Nicolas Saenz Julienne
2022-03-30 12:22 ` [PATCH v3 0/3] util/thread-pool: Expose minimun and maximum size 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=20220316135321.142850-1-nsaenzju@redhat.com \
    --to=nsaenzju@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=fam@euphon.net \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=mtosatti@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).