All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] improve aio-polling efficiency
@ 2026-04-05 20:07 Jaehoon Kim
  2026-04-05 20:07 ` [PATCH v3 1/3] aio-poll: avoid unnecessary polling time computation Jaehoon Kim
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jaehoon Kim @ 2026-04-05 20:07 UTC (permalink / raw)
  To: qemu-devel, qemu-block
  Cc: pbonzini, stefanha, fam, armbru, eblake, berrange, eduardo, dave,
	sw, mjrosato, farman, Jaehoon Kim

Dear all,

This is v3 of the 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/
v2: https://lore.kernel.org/qemu-devel/20260323135451.579655-1-jhkim@linux.ibm.com/

Changes in v3:
- Patch 1/3: Removed timeout check in aio_poll() as suggested by
  Stefan Hajnoczi.

- Patch 2/3: Major refactoring based on review feedback:
  * Removed has_event and renamed poll_idle_timeout to 
    last_dispatch_timestamp from AioHandler structure to identify
    active handlers.
  * Merged grow_polling_time() and shrink_polling_time() into single
    adjust_polling_time() function to simplify code review, with no
    functional changes.
  * Renamed adjust_block_ns() to update_handler_poll_times()
  * Modified remove_idle_poll_handlers() to use last_dispatch_timestamp
    directly instead of checking poll_idle_timeout
  * Updated commit message

- Patch 3/3: Enhanced parameter handling:
  * Moved IOTHREAD_POLL_*_DEFAULT constants to iothread.h header
  * Added validation for poll-weight range [0, 63] in iothread.c
  * Added the divide-by-0 protection in aio_context_set_poll_params()
  * Updated QAPI version from 10.2 to 11.1
  * Enhanced qom.json documentation for poll-weight values

This series reduces CPU usage in aio_poll adaptive polling by ~10%
with minimal throughput impact (~2%). Tested on s390x with various
workloads.

Testing details:

Initial testing (Fedora 42, 16 virtio-blk devices, FCP multipath):
 - Throughput: -3% to -8% (1 iothread), -2% to -5% (2 iothreads)
 - CPU usage: -10% to -25% (1 iothread), -7% to -12% (2 iothreads)

Additional validation (RHEL 10.1 + QEMU 10.0.0, FCP/FICON, 1-8 iothreads):
 - Throughput: -2.2% (weight=3), -2.4% (weight=2)
 - CPU usage: -9.4% (weight=3), -10.9% (weight=2)

Weight=3 selected for slightly better throughput while maintaining
substantial CPU savings.

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                |   7 +-
 include/system/iothread.h         |  18 ++++
 iothread.c                        |  47 +++++++---
 monitor/hmp-cmds.c                |   1 +
 qapi/misc.json                    |   7 ++
 qapi/qom.json                     |  10 +-
 qemu-options.hx                   |   7 +-
 tests/unit/test-nested-aio-poll.c |   2 +-
 util/aio-posix.c                  | 148 ++++++++++++++++++------------
 util/aio-posix.h                  |   2 +-
 util/aio-win32.c                  |   3 +-
 util/async.c                      |   2 +
 12 files changed, 176 insertions(+), 78 deletions(-)

-- 
2.43.0



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

end of thread, other threads:[~2026-04-17 14:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-05 20:07 [PATCH v3 0/3] improve aio-polling efficiency Jaehoon Kim
2026-04-05 20:07 ` [PATCH v3 1/3] aio-poll: avoid unnecessary polling time computation Jaehoon Kim
2026-04-05 20:07 ` [PATCH v3 2/3] aio-poll: refine iothread polling using weighted handler intervals Jaehoon Kim
2026-04-05 20:07 ` [PATCH v3 3/3] qapi/iothread: introduce poll-weight parameter for aio-poll Jaehoon Kim
2026-04-16 14:54   ` Markus Armbruster
2026-04-17 14:48     ` JAEHOON KIM

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.