io_uring/epoll: add multishot support for IORING_OP_EPOLL_WAIT io_uring-epoll-wait.1
authorJens Axboe <axboe@kernel.dk>
Fri, 31 Jan 2025 22:15:46 +0000 (15:15 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 6 Feb 2025 18:42:55 +0000 (11:42 -0700)
commit413eee915371af03dfa0aef1ac0db1a8717f549f
tree32fe63124845951007bb686416b0ad12df9fc0f0
parent70292a4afae517193f3ee4f22c7d708664d1a688
io_uring/epoll: add multishot support for IORING_OP_EPOLL_WAIT

As with other multishot requests, submitting a multishot epoll wait
request will keep it re-armed post the initial trigger. This allows
multiple epoll wait completions per request submitted, every time
events are available. If more completions are expected for this
epoll wait request, then IORING_CQE_F_MORE will be set in the posted
cqe->flags.

For multishot, the request remains on the epoll callback waitqueue
head. This means that epoll doesn't need to juggle the ep->lock
writelock (and disable/enable IRQs) for each invocation of the
reaping loop. That should translate into nice efficiency gains.

Use by setting IORING_EPOLL_WAIT_MULTISHOT in the sqe->epoll_flags
member. Must be used with provided buffers.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/uapi/linux/io_uring.h
io_uring/epoll.c