From: Jens Axboe <[email protected]>
To: [email protected]
Cc: [email protected], [email protected]
Subject: [PATCHSET v3 0/7] io_uring epoll wait support
Date: Fri, 7 Feb 2025 10:32:23 -0700 [thread overview]
Message-ID: <[email protected]> (raw)
Hi,
One issue people consistently run into when converting legacy epoll
event loops with io_uring is that parts of the event loop still needs to
use epoll. And since event loops generally need to wait in one spot,
they add the io_uring fd to the epoll set and continue to use
epoll_wait(2) to wait on events. This is suboptimal on the io_uring
front as there's now an active poller on the ring, and it's suboptimal
as it doesn't give the application the batch waiting (with fine grained
timeouts) that io_uring provides.
This patchset adds support for IORING_OP_EPOLL_WAIT, which does an async
epoll_wait() operation. No sleeping or thread offload is involved, it
relies on the wait_queue_entry callback for retries. With that, then
the above event loops can continue to use epoll for certain parts, but
bundle it all under waiting on the ring itself rather than add the ring
fd to the epoll set.
Patches 1..2 are just prep patches, and patch 3 adds the epoll change
to allow io_uring to queue a callback, if no events are available.
Patches 5..6 are just prep patches on the io_uring side, and patch 7
finally adds IORING_OP_EPOLL_WAIT support
Patches can also be found here:
https://git.kernel.dk/cgit/linux/log/?h=io_uring-epoll-wait
and are against 6.14-rc1 + already pending io_uring patches.
Since v2:
- Drop multishot support, to keep the initial version much simpler
- Drop provided buffers support, not required without multishot
- Cleanup epoll bits, notably adding a separate helper for queueing and
checking for events
- Various other fixes and cleanups
--
Jens Axboe
next reply other threads:[~2025-02-07 17:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-07 17:32 Jens Axboe [this message]
2025-02-07 17:32 ` [PATCH 1/7] eventpoll: abstract out ep_try_send_events() helper Jens Axboe
2025-02-07 17:32 ` [PATCH 2/7] eventpoll: abstract out parameter sanity checking Jens Axboe
2025-02-07 17:32 ` [PATCH 3/7] eventpoll: add epoll_queue() interface Jens Axboe
2025-02-07 17:32 ` [PATCH 4/7] eventpoll: add helper to remove wait entry from wait queue head Jens Axboe
2025-02-07 17:32 ` [PATCH 5/7] io_uring/epoll: remove CONFIG_EPOLL guards Jens Axboe
2025-02-07 17:32 ` [PATCH 6/7] io_uring/poll: pull ownership handling into poll.h Jens Axboe
2025-02-07 17:32 ` [PATCH 7/7] io_uring/epoll: add support for IORING_OP_EPOLL_WAIT Jens Axboe
2025-02-08 23:27 ` Pavel Begunkov
2025-02-09 0:24 ` Pavel Begunkov
2025-02-09 16:19 ` Jens Axboe
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox