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 0/3] util/thread-pool: Expose minimun and maximum size
Date: Mon, 21 Feb 2022 18:08:42 +0100	[thread overview]
Message-ID: <20220221170843.849084-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/

---

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

 MAINTAINERS               |   1 +
 include/block/aio.h       |  11 +++
 include/qemu/main-loop.h  |  11 +++
 include/sysemu/iothread.h |  11 +--
 iothread.c                | 171 ++++----------------------------------
 qapi/qom.json             |  14 ++--
 qga/meson.build           |   2 +-
 qom/meson.build           |   1 +
 tests/unit/meson.build    |  10 +--
 util/async.c              |   3 +
 util/event-loop.c         | 168 +++++++++++++++++++++++++++++++++++++
 util/event-loop.h         |  45 ++++++++++
 util/main-loop.c          |  56 +++++++++++++
 util/thread-pool.c        |  41 ++++++++-
 14 files changed, 368 insertions(+), 177 deletions(-)
 create mode 100644 util/event-loop.c
 create mode 100644 util/event-loop.h

-- 
2.35.1



             reply	other threads:[~2022-02-21 17:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21 17:08 Nicolas Saenz Julienne [this message]
2022-02-21 17:08 ` [PATCH 1/3] util & iothread: Introduce event-loop abstract class Nicolas Saenz Julienne
2022-02-24  9:48   ` Stefan Hajnoczi
2022-02-26  7:36     ` Paolo Bonzini
2022-02-28 19:05     ` Nicolas Saenz Julienne
2022-03-01  9:17       ` Stefan Hajnoczi
2022-02-21 17:08 ` [PATCH 2/3] util/main-loop: Introduce the main loop into QOM Nicolas Saenz Julienne
2022-02-22  6:07   ` Markus Armbruster
2022-02-24 10:01   ` Stefan Hajnoczi
2022-02-28 19:12     ` Nicolas Saenz Julienne
2022-02-21 17:08 ` [PATCH 3/3] util/event-loop: Introduce options to set the thread pool size Nicolas Saenz Julienne
2022-02-24 10:40   ` Stefan Hajnoczi
2022-02-28 19:20     ` Nicolas Saenz Julienne

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=20220221170843.849084-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).