qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] util/thread-pool: Expose minimun and maximum size
@ 2022-02-21 17:08 Nicolas Saenz Julienne
  2022-02-21 17:08 ` [PATCH 1/3] util & iothread: Introduce event-loop abstract class Nicolas Saenz Julienne
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Nicolas Saenz Julienne @ 2022-02-21 17:08 UTC (permalink / raw)
  To: kwolf, stefanha, berrange
  Cc: fam, eduardo, qemu-block, michael.roth, mtosatti, qemu-devel,
	armbru, hreitz, pbonzini, Nicolas Saenz Julienne, eblake

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



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-03-01 10:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-21 17:08 [PATCH 0/3] util/thread-pool: Expose minimun and maximum size Nicolas Saenz Julienne
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

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