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.
Please let me know if I have misunderstood your point.
Thanks,
Jaehoon Kim.