On Wed, May 28, 2025 at 03:09:07PM -0400, Stefan Hajnoczi wrote: > Commit 816a430c517e ("util/aio: Defer disabling poll mode as long as > possible") kept polling enabled when the event loop timeout is 0. Since > there is no timeout the event loop will continue immediately and the > overhead of disabling and re-enabling polling can be avoided. > > fdmon-io_uring.c is unable to take advantage of this optimization > because its ->need_wait() function returns true whenever there are new > io_uring SQEs to submit: > > if (timeout || ctx->fdmon_ops->need_wait(ctx)) { > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > Polling will be disabled even when timeout == 0. > > Extend the optimization to handle the case when need_wait() returns true > and timeout == 0. > > Cc: Chao Gao <chao....@intel.com> > Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com> > ---
Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org