All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Jaehoon Kim <jhkim@linux.ibm.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
	pbonzini@redhat.com, fam@euphon.net, armbru@redhat.com,
	eblake@redhat.com, berrange@redhat.com, eduardo@habkost.net,
	dave@treblig.org, sw@weilnetz.de, mjrosato@linux.ibm.com,
	farman@linux.ibm.com
Subject: Re: [PATCH v5 0/3] improve aio-polling efficiency
Date: Wed, 29 Apr 2026 14:20:54 -0400	[thread overview]
Message-ID: <20260429182054.GA7742@fedora> (raw)
In-Reply-To: <20260423195918.661299-1-jhkim@linux.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 4220 bytes --]

On Thu, Apr 23, 2026 at 02:59:15PM -0500, Jaehoon Kim wrote:
> Dear all,
> 
> This is v5 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/
> v3: https://lore.kernel.org/qemu-devel/20260405200735.3075407-1-jhkim@linux.ibm.com/
> v4: https://lore.kernel.org/qemu-devel/20260412215011.326196-1-jhkim@linux.ibm.com/
> 
> Changes in v5:
> - Patch 3/3: Fixed QAPI documentation based on review feedback:
>   * qapi/misc.json: Removed the sentence about returning poll-weight=0
>     since query-iothreads never returns 0 for this field.
>   * qemu-options.hx: Enhanced poll-weight parameter documentation to
>     match the detail level in qom.json, including information about
>     default value and typical value examples.
> 
> Changes in v4:
> - Patch 2/3: Added detailed validation tables showing poll.ns statistics
>   across different poll_weight values (1-5) for SSD randread/randwrite
>   workloads to demonstrate algorithm behavior and justify poll_weight=3
>   as the optimal default.
> 
> - Patch 3/3: Fixed commit message to correctly reference
>   adjust_polling_time() instead of the removed grow_polling_time()
>   and shrink_polling_time() functions from v2.
> 
> 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                    |   6 ++
>  qapi/qom.json                     |  10 +-
>  qemu-options.hx                   |   8 +-
>  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.50.1
> 

Thanks, applied to my block tree:
https://gitlab.com/stefanha/qemu/commits/block

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      parent reply	other threads:[~2026-04-29 18:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-23 19:59 [PATCH v5 0/3] improve aio-polling efficiency Jaehoon Kim
2026-04-23 19:59 ` [PATCH v5 1/3] aio-poll: avoid unnecessary polling time computation Jaehoon Kim
2026-04-23 19:59 ` [PATCH v5 2/3] aio-poll: refine iothread polling using weighted handler intervals Jaehoon Kim
2026-04-23 19:59 ` [PATCH v5 3/3] qapi/iothread: introduce poll-weight parameter for aio-poll Jaehoon Kim
2026-04-24  6:26   ` Markus Armbruster
2026-04-29 18:20 ` Stefan Hajnoczi [this message]

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=20260429182054.GA7742@fedora \
    --to=stefanha@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dave@treblig.org \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=fam@euphon.net \
    --cc=farman@linux.ibm.com \
    --cc=jhkim@linux.ibm.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /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 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.