aboutsummaryrefslogtreecommitdiff
path: root/util/fdmon-epoll.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2020-03-05 17:08:05 +0000
committerStefan Hajnoczi <stefanha@redhat.com>2020-03-09 16:41:31 +0000
commitaa38e19f05c3a5ae64dff84f44e1aa31281a5b14 (patch)
tree511a1cbddc11aee4e8b4ff22469189136cc125d9 /util/fdmon-epoll.c
parent73fd282e7b6dd4e4ea1c3bbb3d302c8db51e4ccf (diff)
aio-posix: support userspace polling of fd monitoring
Unlike ppoll(2) and epoll(7), Linux io_uring completions can be polled from userspace. Previously userspace polling was only allowed when all AioHandler's had an ->io_poll() callback. This prevented starvation of fds by userspace pollable handlers. Add the FDMonOps->need_wait() callback that enables userspace polling even when some AioHandlers lack ->io_poll(). For example, it's now possible to do userspace polling when a TCP/IP socket is monitored thanks to Linux io_uring. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Link: https://lore.kernel.org/r/20200305170806.1313245-7-stefanha@redhat.com Message-Id: <20200305170806.1313245-7-stefanha@redhat.com>
Diffstat (limited to 'util/fdmon-epoll.c')
-rw-r--r--util/fdmon-epoll.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/util/fdmon-epoll.c b/util/fdmon-epoll.c
index d56b69468b..fcd989d47d 100644
--- a/util/fdmon-epoll.c
+++ b/util/fdmon-epoll.c
@@ -100,6 +100,7 @@ out:
static const FDMonOps fdmon_epoll_ops = {
.update = fdmon_epoll_update,
.wait = fdmon_epoll_wait,
+ .need_wait = aio_poll_disabled,
};
static bool fdmon_epoll_try_enable(AioContext *ctx)