From 7797158ea67304507f9811741e9f00dff5858974 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 21 Feb 2025 16:08:43 +0100 Subject: [PATCH] event/Loop: auto-restart io_uring_prep_poll_multishot() Applications need to check the `IORING_CQE_F_MORE` flag to see whether the kernel is still polling, or whether it has stopped for some reason. --- src/event/Loop.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/event/Loop.cxx b/src/event/Loop.cxx index e9716649f..c4962a8d0 100644 --- a/src/event/Loop.cxx +++ b/src/event/Loop.cxx @@ -75,6 +75,12 @@ private: (void)res; // TODO event_loop.epoll_ready = true; + + if (!IsUringPending()) [[unlikely]] + /* for some reason, the kernel has stopped our + poll operation (no IORING_CQE_F_MORE): + restart the poll */ + Start(); } };