public inbox for qemu-devel@nongnu.org
 help / color / mirror / Atom feed
* [PATCH RFC v2 0/3] improve aio-polling efficiency
@ 2026-03-23 13:54 Jaehoon Kim
  2026-03-23 13:54 ` [PATCH RFC v2 1/3] aio-poll: avoid unnecessary polling time computation Jaehoon Kim
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jaehoon Kim @ 2026-03-23 13:54 UTC (permalink / raw)
  To: qemu-devel, qemu-block
  Cc: mjrosato, farman, pbonzini, stefanha, fam, armbru, eblake,
	berrange, eduardo, dave, sw, Jaehoon Kim

Dear all,

This is v2 of the RFC patch series to refine aio_poll adaptive
polling logic for better CPU efficiency.

v1: 
https://lore.kernel.org/qemu-devel/20260113174824.464720-1-jhkim@linux.ibm.com/

Changes in v2:
- Patch 2/3: Changed default POLL_WEIGHT_SHIFT from 2 to 3
  based on extensive testing. Updated commit message with
  detailed performance comparison showing weight=3 provides
  better balance between throughput and CPU savings

- Patch 3/3: Added proper initialization of poll-weight,
  poll-grow, and poll-shrink defaults in iothread.c

This patch series refines the aio_poll adaptive polling logic to
reduce unnecessary busy-waiting and improve CPU efficiency.

The first patch prevents redundant polling time calculation when
polling is disabled. The second patch enhances the adaptive polling
mechanism by dynamically adjusting the iothread's polling duration
based on event intervals measured by individual AioHandlers. The
third patch introduces a new 'poll-weight' parameter for runtime
control over how much the current interval influences the next
polling duration.

We evaluated the patches on s390x hosts with different configurations:

Initial testing (Fedora 42):
Using a single guest with 16 virtio block devices backed by FCP
multipath devices, I/O scheduler set to 'none'. Across four FIO
workload patterns (sequential R/W, random R/W), averaged over
numjobs 1, 4, 8, and 16:

 - Throughput: -3% to -8% (one iothread), -2% to -5% (two iothreads)
 - CPU usage: -10% to -25% (one iothread), -7% to -12% (two iothreads)

Additional validation (RHEL 10.1 GA + QEMU 10.0.0):
Comparing baseline vs poll-weight=2/3 with FCP and FICON storage,
using 1 and 8 iothreads, averaged over numjobs 1, 4, and 8:

Summary of results (% change vs baseline):

 - Throughput avg: -2.2% (weight=3), -2.4% (weight=2)
 - CPU consumption avg: -9.4% (weight=3), -10.9% (weight=2)

Weight=3 was selected as default for providing slightly better
throughput (-2.2% vs -2.4%) while maintaining substantial CPU
savings (-9.4%).

Best regards,
Jaehoon Kim

Jaehoon Kim (3):
  aio-poll: avoid unnecessary polling time computation
  aio-poll: refine iothread polling using weighted handler intervals
  qapi/iothread: introduce poll-weight parameter for aio-poll

 include/qemu/aio.h                |   8 +-
 include/system/iothread.h         |   1 +
 iothread.c                        |  34 ++++++-
 monitor/hmp-cmds.c                |   1 +
 qapi/misc.json                    |   7 ++
 qapi/qom.json                     |   8 +-
 qemu-options.hx                   |   7 +-
 tests/unit/test-nested-aio-poll.c |   2 +-
 util/aio-posix.c                  | 141 ++++++++++++++++++++----------
 util/aio-win32.c                  |   3 +-
 util/async.c                      |   2 +
 11 files changed, 161 insertions(+), 53 deletions(-)

-- 
2.50.1



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

end of thread, other threads:[~2026-03-25 20:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-23 13:54 [PATCH RFC v2 0/3] improve aio-polling efficiency Jaehoon Kim
2026-03-23 13:54 ` [PATCH RFC v2 1/3] aio-poll: avoid unnecessary polling time computation Jaehoon Kim
2026-03-25 17:22   ` Stefan Hajnoczi
2026-03-23 13:54 ` [PATCH RFC v2 2/3] aio-poll: refine iothread polling using weighted handler intervals Jaehoon Kim
2026-03-25 20:37   ` Stefan Hajnoczi
2026-03-23 13:54 ` [PATCH RFC v2 3/3] qapi/iothread: introduce poll-weight parameter for aio-poll Jaehoon Kim
2026-03-25 14:04   ` Markus Armbruster
2026-03-25 16:52   ` Stefan Hajnoczi
2026-03-25 16:56   ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox