Linux block subsystem maintainer and IO_uring lead developer Jens Axboe continues to uncover new opportunities for making the wonderful IO_uring framework even more performant within the Linux kernel. For ending out the week he's posted some "crazy" patches delivering some significant gains. Axboe's latest work is focused on improvving the kernel blocking behavior. Axboe described the work in today's RFC patch series: "io_uring issues requests inline with IO_URING_F_NONBLOCK and punts to io-wq when that isn't possible. For a range of opcodes it isn't possible at all, as there's no nonblocking path in the kernel for them: fsync, statx, openat, the *at family, xattr, fadvise, splice, etc. Those are punted unconditionally, and the punt costs a thread wakeup, a context switch and a task_work completion round trip per request. io_uring HAS to be cautious to prevent accidental blocking in the kernel, even if the operations predominantly never block. Sad story. Examples of that are things like an fdatasync that doesn't block, statx that hits dcache, openat for O_TMPFILE, etc. All of those would've completed inline just fine, but io_uring just cannot rely on that. This series issues those requests inline in blocking mode instead, and only pays for the offload if the request actually blocks. But by the time it blocks, the submitter is deep in the kernel with the request on its stack, so the work can't be moved to another thread. What we can move is the identity. If the submitting task blocks, an idle io-wq worker takes over its user visible identity (tid, signal state, credentials, scheduling attributes, cgroup, user register state), finishes the io_uring_enter() call and returns to userspace as the submitter. The original task finishes the request as an io-wq worker and joins the pool. Userspace is none the wiser, hopefully, the same tid came back from the syscall, it's just on a different task_struct. Folks that have been around a while may remember earlier attempts at this about 20 years ago." Axboe posted on X about these "crazy patches" and in turn shared some graphics of these new "tasty results" out of IO_uring, which will be most exciting for users not concerned about the internal technicals of this change: We'll see where this work leads and if it ends up being ready for mainline by the Linux v7.4 cycle.
Linux's IO_uring Sees Some "Crazy" Patches That Deliver Very Nice Improvements
Full Article
Original Source
Read the full article at Phoronix →KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.