Linux Kernel Getting io_uring To Deliver Fast & Efficient I/O
Linux block maintainer and developer behind io_uring, Jens Axboe of Facebook, queued the new interface overnight into the linux-block/for-next on Git. The io_uring interface provides submission and completion queue rings that are shared between the application and kernel to avoid excess copies. The new interface has just two new system calls (io_uring_setup and io_uring_enter) for dealing with I/O. Axboe previously worked on this code under the "aioring" name.
Io_uring is a lot more efficient than Linux's AIO asynchronous I/O code, there is efficient buffered asynchronous I/O support, the ability to do I/O without even performing a system call via polled I/O, and other efficiency enhancements. The interface patch goes on to explain:
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.The design philosophy with io_uring appears to be on delivering fast and efficient I/O for Linux.
For IRQ driven IO, an application only needs to enter the kernel for completions if it wants to wait for them to occur.
Each io_uring is backed by a workqueue, to support buffered async IO as well. We will only punt to an async context if the command would need to wait for IO on the device side. Any data that can be accessed directly in the page cache is done inline. This avoids the slowness issue of usual threadpools, since cached data is accessed as quickly as a sync interface.
There is liburing as the user-space library built around the new interfaces. Axboe's FIO benchmark has also been adapted already to support io_uring. This should be another feature worth getting excited about come Linux 5.1.