io_uring
- A journeySometimes you really just need to make as few system calls as possible and ever since io_uring was added to Linux kernel 5.1, I’ve been wanting to try and use it for asynchronous network I/O instead of things like epoll, select, etc.
This led me to document this process and hopefully provide something useful to others doing the same (including future me).
For a very brief introduction to what io_uring
is, here’s a quote from kernel patch introducing the feature:
With this setup, it’s possible to do async IO with a single system call. Future developments will enable polled IO with this interface, and polled submission as well. The latter will enable an application to do IO without doing ANY system calls at all.
If you are not familiar with io_uring
, I’d suggest taking a look at the Lord of the io_uring guide first.
The posts that follow discuss the more practical aspects of implementing basic async network I/O with io_uring
and will cover everything one can do with io_uring
(which is a lot).
While the motivation for using io_uring
is to have highly performant asynchronous I/O, this series will not contain any benchmarks or performance comparisons. There is a very interesting discussion on this subject that’s worth reading.
Here’s my journal