IO_uring Continues To Prove Very Exciting: Promising io_uring_spawn Announced
Josh Triplett, who is a former notable Intel Linux engineer and more recently focused on the Rust programming language where he co-leads the Rust language team, announced his work on io_uring_spawn yesterday at LPC 2022. Triplett sums it up pretty elegantly in his talk abstract:
io_uring allows running a batch of operations fast, on behalf of the current process. As the name suggests, this works exceptionally well for I/O workloads. However, one of the most prominent workloads in software development involves executing other processes: make and other build systems launch many other processes over the course of a build. How can we launch those processes faster?
What if we could launch other processes, and give them initial work to do using io_uring, ending with an exec? What if we could handle the pre-exec steps for a new process entirely in the kernel, with no userspace required, eliminating the need for fork or even vfork, and eliminating page-table CoW overhead?
In this talk, I'll introduce io_uring_spawn, a mechanism for launching empty new processes with an associated io_uring. I'll show how the kernel can launch a blank process, with no initial copy-on-write page tables, and initialize all of its resources from an io_uring. I'll walk through both the successful path and the error-handling path, and show how to get information about the launched process. Finally, I'll show how existing userspace can take advantage of io_uring_spawn to speed up posix_spawn, and provide performance numbers for common workloads, including kernel compilation.
Indeed his benchmark results speak for themselves with io_uring_spawn being much faster than fork or posix_spawn and even 6~10% faster than vfork while being attributed as safer and more flexible.
Josh Triplett's work on io_uring_spawn is looking very exciting but still in the early stages of the implementation.
This is a very promising start to io_uring_spawn to which he says he's "just getting started". He's looking forward to next implementing posix_spawn atop it, supporting a pre-spawned process pool, and optimizing clone further. Those wishing to learn much more about this promising io_uring_spawn work can see Josh Tripplett's presentation below and the PDF slide deck.