3 ms·
>Another one is I could not find a benchmark with io_uring - this would confirm the benefit of going from epoll. One of the advantages of io_uring, unrelated t
by mahkoh 2y ago
>Another one is I could not find a benchmark with io_uring - this would confirm the benefit of going from epoll.
One of the advantages of io_uring, unrelated to performance, is that it supports non-blocking operations on blocking file descriptors.
Using io_uring is the only method I recall to bypass https://gitlab.freedesktop.org/wayland/wayland/-/issues/296 https://gitlab.freedesktop.org/wayland/wayland/-/issues/296. This issue deals with having to operate on untrusted file descriptors where the blocking/non-blocking state of the file descriptions might be manipulated by an adversary at any time.
- lukeh 2y agoAlso useful for things like SPI with only blocking user space API.
- o11c 2y agoI thought for sure this was wrong, but when I actually checked the docs, it turns out that `RWF_NOWAIT` is only valid for `preadv2` not `pwritev2`. This should probably be fixed. For sockets, `MSG_DONTWAIT` works with both `recv` and `send`. For pipes you should be able to do this with `SPLICE_F_NONBLOCK` and the `splice` family, but there are weird restrictions for those.
- kragen 2y agoSo does the FIONREAD ioctl, but it's not a general solution. (According to https://news.ycombinator.com/item?id=42617719 https://news.ycombinator.com/item?id=42617719, neither is io_uring yet.) Thanks for the link to the horrifying security problem!