From: JAEHOON KIM <jhkim@linux.ibm.com>
To: Stefan Hajnoczi <stefanha@redhat.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
Subject: Re: [PATCH RFC v1 1/3] aio-poll: avoid unnecessary polling time computation
Date: Wed, 18 Feb 2026 07:43:56 -0600 [thread overview]
Message-ID: <b4ad76d0-e3ca-4e68-b382-bc73663d77b6@linux.ibm.com> (raw)
In-Reply-To: <20260217131603.GA442289@fedora>
On 2/17/2026 7:16 AM, Stefan Hajnoczi wrote:
> On Mon, Feb 16, 2026 at 02:47:27PM -0600, JAEHOON KIM wrote:
>> On 2/16/2026 9:21 AM, Stefan Hajnoczi wrote:
>>> On Tue, Jan 13, 2026 at 11:48:22AM -0600, Jaehoon Kim wrote:
>>>> Nodes are no longer added to poll_aio_handlers when adaptive polling is
>>>> disabled, preventing unnecessary try_poll_mode() calls. Additionally,
>>>> aio_poll() skips try_poll_mode() when timeout is 0.
>>>>
>>>> This avoids iterating over all nodes to compute max_ns unnecessarily
>>>> when polling is disabled or timeout is 0.
>>> Did you consider optimizing the case when polling is active and there is
>>> no way around calculating the polling time? Glib has ordered data
>>> structures that have lower operation costs than O(n).
>>>
>>> Stefan
>> If I understand correctly, while optimizing the data structure to be cheaper
>> than O(n) is one approach, I believe bypassing the function entirely
>> efficient
>> for cases where timeout=0 is frequently triggered.
>>
>> Since the result of the calculation is not used at all in these cases, it
>> seems
>> to more efficient to skip the function than to optimize calculation itself.
> Yes, skipping it when not needed makes sense and I'm in favor of it.
>
> I was thinking that, separately from this patch, the data structure
> might be worth optimizing since the value needs to be computed when
> polling is enabled.
>
> Stefan
That makes sense. I agree that when polling is enabled, optimizing the
data structure could help reduce the overhead of computing the value.
I'll take a closer look at potential improvements there.
Thanks,
Jaehoon
next prev parent reply other threads:[~2026-02-18 13:44 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 17:48 [PATCH RFC v1 0/3] aio-poll: improve aio-polling efficiency Jaehoon Kim
2026-01-13 17:48 ` [PATCH RFC v1 1/3] aio-poll: avoid unnecessary polling time computation Jaehoon Kim
2026-02-16 14:58 ` Stefan Hajnoczi
2026-02-16 15:21 ` Stefan Hajnoczi
2026-02-16 20:47 ` JAEHOON KIM
2026-02-17 13:16 ` Stefan Hajnoczi
2026-02-18 13:43 ` JAEHOON KIM [this message]
2026-01-13 17:48 ` [PATCH RFC v1 2/3] aio-poll: refine iothread polling using weighted handler intervals Jaehoon Kim
2026-01-13 17:48 ` [PATCH RFC v1 3/3] qapi/iothread: introduce poll-weight parameter for aio-poll Jaehoon Kim
2026-01-14 7:48 ` Markus Armbruster
2026-01-15 5:14 ` JAEHOON KIM
2026-01-15 7:28 ` Markus Armbruster
2026-01-15 10:05 ` Halil Pasic
2026-01-15 16:00 ` JAEHOON KIM
2026-01-16 8:19 ` Markus Armbruster
2026-01-19 18:16 ` [PATCH RFC v1 0/3] aio-poll: improve aio-polling efficiency Stefan Hajnoczi
2026-01-23 19:15 ` JAEHOON KIM
2026-01-27 21:11 ` Stefan Hajnoczi
2026-02-03 21:12 ` Stefan Hajnoczi
2026-02-06 6:50 ` JAEHOON KIM
2026-02-12 18:53 ` Stefan Hajnoczi
2026-02-13 15:13 ` JAEHOON KIM
2026-02-16 12:42 ` Stefan Hajnoczi
2026-02-19 22:27 ` Stefan Hajnoczi
2026-02-20 19:00 ` JAEHOON KIM
2026-02-24 4:24 ` Stefan Hajnoczi
2026-02-26 6:03 ` JAEHOON KIM
2026-03-09 20:46 ` JAEHOON KIM
2026-03-23 14:08 ` JAEHOON KIM
2026-03-23 18:51 ` Stefan Hajnoczi
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=b4ad76d0-e3ca-4e68-b382-bc73663d77b6@linux.ibm.com \
--to=jhkim@linux.ibm.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=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--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.