Systems Distributed '26

The Design and Evolution of io_uring

Meta
io_uring · SD '26
§1.1

122M IOPS
a single 2U box · > 80% of the machine idle
t/io_uring on 24 NVMe drives - polled, registered files/buffers. Maximum IOPS = 121.97M @ ~59.5 GiB/s.
io_uring · SD '26
§1.2

The world we came from

  • UNIX says everything is a file - yet treats I/O for different file types completely differently.
  • Linux "had" asynchronous I/O for over a decade…
  • …and it couldn't actually do async I/O.
  • native AIO worked only under O_DIRECT, and silently blocked everywhere else.
  • That number was simply unreachable in the old world.
io_uring · SD '26
§1.3

Why did reading a file and reading a socket
ever need two completely different access paradigms?

io_uring · SD '26
§2

About me

  • Created and maintain io_uring and liburing.
  • Author of fio - a storage benchmarking tool.
  • Long-time Linux block layer maintainer - I/O schedulers, blk-mq, and more.
  • Decades of working on Linux storage and I/O.
  • Recently combining io_uring and racing…
io_uring · SD '26
SQCQ
§2.1

Traxs - io_uring goes racing

Traxs - a racing telemetry & video-analysis app I built. Lap deltas, onboard video synced to the data, setup analysis and suggestion engine, corner/section analysis, a track map. io_uring backend uses TX zero-copy with kTLS for video streaming. (Radical SR3 XXR · Road Atlanta.)
io_uring · SD '26
§03

What came before

io_uring · SD '26
§3.1

Native AIO / libaio - the storage-only status quo

  • Native AIO (io_submit) - only worked for O_DIRECT, silently blocked otherwise.
  • Buffered I/O never went async - it quietly fell back to synchronous.
  • Even O_DIRECT I/O would randomly block.
  • Thread-pool workarounds (glibc POSIX AIO, userspace pools) - everyone built them and pretended.
  • Never any networking: storage-shaped opcodes only. Sockets stayed on the readiness model.
io_uring · SD '26
§3.2

Threadlets & fibrils (2007)

  • "Make any syscall async" is a 20-year-old idea.
  • Fibrils (Zach Brown) - lightweight in-kernel threads; Linus liked the direction.
  • Syslets / threadlets (Ingo Molnar) - reuse ordinary kernel threads.
  • "Either you go for programmability or performance. There is no middle ground for us in the kernel."
  • Neither merged.
io_uring · SD '26
§3.3

Where they all fell short

  • Fibrils and syslets always routed work through an offload path - a fibril or a pooled thread.
  • Syslets could even return to userspace with a different PID than you entered the kernel with - the thread migrated underneath you.
  • Neither handled the case that dominates: cached data should complete inline, no thread at all.
  • That inline fast path is exactly what io_uring gets right.
  • io-wq is just the last-resort fallback - not the highlight.
io_uring · SD '26
§3.4

The Linus opening

  • epoll - Linus has always hated epoll, and has repeatedly stated so in public.
  • Native AIO - he dismissed it as an O_DIRECT cornercase, useless for normal apps.
  • "AIO is a horrible ad-hoc design … database people - who seldom have any shred of taste - actually use it." - Linus, LKML
io_uring · SD '26
§04

The design

io_uring · SD '26
§4.1

The rings

shared memory · mmap() Application produces SQ · consumes CQ Kernel consumes SQ · produces CQ SQ submission CQ completion head tail head tail submit SQE kernel reads post CQE reap CQE
io_uring · SD '26
§4.2

The completion fast path

submit inline attempt CQE post cqe notification fires later task_work post cqe io-wq blocking submit task_work on notify submit re-submit arm notification handler? 1 · success 2 · queued async 3 · neither armed arm failed blocking submit
io_uring · SD '26
§4.3

The fast path, block I/O

submit queue the I/O block layer I/O in flight later · device IRQ block IRQ completion = notify task_work queued CQE post cqe submit only queues the I/O - the block layer's completion IRQ is the notification that drives task_work to post the CQE. No io-wq.
io_uring · SD '26
§4.4

The fast path, networking

submit recv/send no data/space yet arm poll wait for wakeup later · IRQ · packet arrives net poll handler notifies us task_work queued retry recv/send data ready now CQE post cqe no data, so arm a poll; the packet's IRQ fires the poll handler, which notifies us - task_work retries the op and posts the CQE. Still no worker thread.
io_uring · SD '26
§4.5

The great unifier

  • Since the '70s: regular files vs. pollable files (sockets, pipes) - two I/O models.
  • Readiness (ask first) vs. just-do-it.
  • io_uring collapses them into one completion model, regardless of what's on the other end.
  • One model Windows got correct. But then, "I/O Ring API (ioringapi)"…
  • Submit an operation, get a completion.
Observing engineers programming readiness-based networking in their natural habitat.
Hennepin County Library · public domain.
io_uring · SD '26
§05

liburing

the API people actually use
io_uring · SD '26
§5.1

The simplest async read

#include <liburing.h>

fdfile = open("file.txt", O_RDONLY);    /* a file - but could be a socket, pipe, any fd */

/* describe one read - no syscall yet */
sqe = io_uring_get_sqe(ring);
io_uring_prep_read(sqe, fdfile, buf, sizeof(buf), 0);

/* hand it to the kernel, then wait */
io_uring_submit(ring);
io_uring_wait_cqe(ring, &cqe);

printf("read %d bytes\n", cqe->res);      /* res = bytes, or -errno */
io_uring_cqe_seen(ring, cqe);            /* tell kernel the app has seen this CQE */
io_uring · SD '26
§5.1

The simplest async read

#include <liburing.h>

pipe(fds);                              /* a pipe now - the read code below doesn't change */

/* describe one read - no syscall yet */
sqe = io_uring_get_sqe(ring);
io_uring_prep_read(sqe, fds[0], buf, sizeof(buf), 0);

/* hand it to the kernel, then wait */
io_uring_submit(ring);
io_uring_wait_cqe(ring, &cqe);

printf("read %d bytes\n", cqe->res);      /* res = bytes, or -errno */
io_uring_cqe_seen(ring, cqe);            /* tell kernel the app has seen this CQE */
io_uring · SD '26
§5.1

The simplest async read

#include <liburing.h>

pipe(fds);                              /* a pipe now - the read code below doesn't change */

/* describe one read - no syscall yet */
sqe = io_uring_get_sqe(ring);
io_uring_prep_read(sqe, fds[0], buf, sizeof(buf), 0);

/* submit + wait in one syscall, then grab the ready CQE */
io_uring_submit_and_wait(ring, 1);
io_uring_peek_cqe(ring, &cqe);

printf("read %d bytes\n", cqe->res);      /* res = bytes, or -errno */
io_uring_cqe_seen(ring, cqe);            /* tell kernel the app has seen this CQE */
io_uring · SD '26
§5.2

What liburing does

  • Ring setup & mmap, per-opcode prep helpers, submit and reap.
  • Prep helpers for command setup - io_uring_prep_accept(), io_uring_prep_openat(), io_uring_prep_sync_file_range(), …
  • The memory ordering between app and kernel.
  • Kernel-version differences (feature probing); new opcodes surface as new helpers.
struct io_uring userspace sq struct io_uring_sq *khead *ktail *sqes → SQ ring ring_mask · ring_entries · sqe_head/tail (local) cq struct io_uring_cq *khead *ktail *cqes → CQ ring ring_mask · ring_entries (local) flags · ring_fd · features · enter_ring_fd (local) mmap · shared with kernel the mapped rings SQ ring head · tail · flags sqe[0] sqe[1] sqe[2] sqe[3] CQ ring head · tail · overflow cqe[0] cqe[1] cqe[2] cqe[3]
io_uring · SD '26
§5.3

Not just sugar

  • It's where the correct usage patterns live.
  • That lets the kernel ABI stay minimal and stable while ergonomics evolve in userspace.
  • Evolves with the kernel, but is not tied to a kernel version.
  • Easy to use, hard to misuse.
  • Comes with a rich set of man pages.
  • Kernel io_uring regression & functionality tests live here.
  • Includes various examples as well, not just tests.
io_uring · SD '26
§06

io_uring and task_work

io_uring · SD '26
§6.1

What task_work is

  • Tightly managed deferred work processing and wakeup handling.
completion IRQ / other CPU - anywhere queue task_work queued on the owning task safe point → userspace callback runs in the task's context → CQE
io_uring · SD '26
§6.2

Why io_uring leans on it

  • Completions and retries run in the owning task's context - cache-hot, the op just "completes."
  • Single-task access eliminates locking - no contention on the completion path.
  • Async finishes without io-wq: task_work completes or retries in-context.
  • Ordering & batching from one controlled point.
io_uring · SD '26
§6.3

DEFER_TASKRUN

default every kernel entry read() tw write() tw signal tw enter(wait) tw DEFER_TASKRUN only at the ring wait read() deferred write() deferred signal deferred enter(wait) tw
io_uring · SD '26
§6.4

Lockless MPSC queues (2026)

  • Old path built the queue as an llist, then ran llist_reverse() before running.
  • Reverse walk can act as a cache pre-load - but the payoff depends entirely on how many items there are.
  • At the loaded end, it's worse. Pre-load is harmful, and list reversal is a cycle eater.
  • Native MPSC FIFO has constant overhead.
llist LIFO 1·2·3 stored (reversed) 3 2 1 reverse O(n) in order 1 2 3 run mpscq FIFO 1·2·3 stored (in order) 1 2 3 run in order - no reversal
io_uring · SD '26
§07

Evolution

io_uring · SD '26
§7.1

IORING_FEAT_FAST_POLL

  • Enabled efficient IO on pollable files.
  • Before this, io-wq was always used to drive -EAGAIN retries.
  • This is outcome 2 of the fast path (§4.2, §4.4) - the groundwork the multishot poll / recv / accept work builds on.
io_uring · SD '26
§7.2

Registered buffers

  • Pre-register buffers once.
  • Removes per-op page pinning and mapping from the hot path.
regular buffer registered buffer submit get_user_pages() get page refs do IO shared unmap put pages CQE submit do IO shared CQE skipped · get_user_pages + refs skipped · unmap + put pages registered buffers pin the pages once - the per-IO map/pin and unmap/put disappear
io_uring · SD '26
§7.3

Registered files

regular file registered file submit fget() fd → file, +ref do IO shared fput() drop ref CQE submit do IO shared CQE skipped · fget skipped · fput registered files hold the struct file in the ring - the per-op fget lookup + ref and the fput disappear
io_uring · SD '26
§7.4

Multishot - one submit, many completions

single-shot app submit SQE CQE reap CQE, re-submit each event multishot app submit SQE CQE CQE CQE one submit - stays armed
io_uring · SD '26
§7.5

recv, step by step

recv submit poll wait for wakeup task_work queued no data wakeup recv retry CQE data in buffer data ready
io_uring · SD '26
§7.6

Multishot recv + ring-provided buffers

recv no buffer multishot poll wait for wakeup task_work queued no data wakeup recv retry CQE buf #k filled Application provided buffer ring. May be individual buffers, or larger incrementally consumed ones. kernel picks multishot - stays armed, next wakeup
io_uring · SD '26
§7.7

Recv bundles - drain a burst in two ops

  • Bundling multishot recv with provided buffers drains a burst - no recv per buffer.
  • recv #1 takes one segment and returns the socket's queued size (INQ) in the msghdr; recv #2 sizes an iovec to it and takes the rest in one go.
  • Fewer trips through the networking stack - and those trips are expensive.
step 1 - take one segment, learn how much is left recv #1 seg 1 msghdr → INQ N bytes still queued step 2 - drain the rest in one recv recv #2 iovec seg 2 seg 3 seg 4 … the rest - one recv no per-buffer round-trips sizes the iovec
io_uring · SD '26
§7.8

Zero-copy networking

  • Zero-copy send and receive - data to/from the wire without the usual kernel copy.
  • Memory bandwidth limited services are increasingly common.
  • No more of the cmsg / error queue dance sync zero-copy needs for completion notifications - io_uring posts a normal CQE.
io_uring · SD '26
§7.9

ublk - block devices in userspace

  • Implement a full block device in userspace, backed by io_uring (URING_CMD).
  • Apps see a normal /dev/ublkbN; a userspace daemon serves every I/O - like FUSE for block.
kernel user space user space application block I/O /dev/ublkb block device ublk driver forwards I/O ublk server userspace daemon backend net / file / … io_uring · fetch request commit result
io_uring · SD '26
§7.10

Storage → networking → "everything is an op"

  • From a storage-I/O interface to a general one - networking, then the opcode explosion.
  • But not every op is a syscall hook - some exist only in io_uring:
  • MSG_RING - post a CQE, or pass an fd, directly to another ring.
  • WAITID and FUTEX - non-I/O opcodes, genuinely useful to wait on through the ring.
  • URING_CMD - passthrough command channel into drivers (NVMe passthrough, ublk).
io_uring · SD '26
§08

The security story

io_uring · SD '26
§8.1

The really early flaws

  • Original async offload via io-wq used kernel threads, by default carrying kernel credentials.
  • io_uring then went to great lengths to assume the original submitter's personality.
  • The structural fix - 5.12: PF_IO_WORKER threads of the owning process, its mm & creds.
io_uring · SD '26
§8.2

Why it's still disabled in spots

  • Docker seccomp blocks the syscalls; Google disabled it on ChromeOS / Android / servers (for user applications).
  • The real driver: io_uring is effectively a seccomp bypass - ops don't map to filtered syscalls.
  • io_uring LSM hooks + BPF filtering let sandboxes manage it instead of banning it.
io_uring · SD '26
§8.3

cBPF task filtering

  • io_uring ops are filtered by a cBPF program on the task - inherited on fork, and a child may only ever further restrict.
  • The seccomp model containers & systemd already use. Classic BPF, not eBPF - many containers disable eBPF.
cBPF filter (io_uring policy) systemd / container installs base policy base service fork() base +service worker fork() base service +worker fork · inherits filter fork · inherits filter
io_uring · SD '26
§8.4

Where it actually stands

  • The disabling gets conflated with the really-early flaws (§8.1) - but they're different things.
  • CVE rate is now low - comparable or better than other core APIs.
  • A recent "432 Linux kernel CVEs posted in one day"? Zero in io_uring.
  • cBPF task filtering (§8.3) enables sandboxes and containers to allow io_uring, while limiting it as they do syscalls.
  • The "io_uring is a security disaster" narrative is out of date.
io_uring · SD '26
§09

What's next

io_uring · SD '26
§9.1

Zero-copy, rx and tx

  • Host memory works today.
  • Device memory (GPU / accelerator) is pending and under active development - the NIC lands the payload straight in device memory - one op instead of two, no host-RAM bounce, half the PCIe traffic.
host bounce today - via host RAM ① recv ② DMA to GPU NIC host RAM bounce CQE submit new SQE GPU memory device CQE wire DMA DMA two submit/complete cycles · payload crosses PCIe twice zero-copy rx one op - straight to device memory NIC headers → host stack host RAM skipped GPU memory registered buf CQE wire DMA direct - NIC writes the payload straight into GPU memory
io_uring · SD '26
§9.2

Pre-mapped DMA - buffers on steroids

  • Pre-map buffers for DMA once ("IO slots") - the per-op mapping cost disappears.
  • ~9.1M IOPS on a single EPYC core, a 66% jump over plain O_DIRECT. (LSFMM: "can we get closer to SPDK?")
regular buffer submit pin pages DMA map do IO shared DMA unmap put pages CQE registered buffer submit skipped · pin pages DMA map do IO shared DMA unmap skipped · put pages CQE pre-mapped DMA submit skipped · pin pages skipped · DMA map do IO shared DMA sync cheap skipped · put pages CQE regular → registered (skip page pinning) → pre-mapped (skip the DMA map too; unmap becomes a cheap sync)
io_uring · SD '26
§9.3

Protocol-aware wakes - BPF gating

  • Many sockets, interleaved receives → CQE floods and partial, discontiguous data.
  • A BPF program inspects the header and gates the wake: one wake + recv when the whole message has arrived, no partial wakes.
no gating the app loops until the message is complete notify wake recv post cqe app: done? yes done sleep wait no only the app knows done - so it loops BPF poll gating partials stop at the gate notify BPF gate wake recv post cqe complete only when the message is complete partial → hold, no wake - the common case
io_uring · SD '26
§10

So - why did reading a file and reading a socket
ever need two completely different access paradigms?
They don't.
io_uring · SD '26

Thank you!

Questions?
io_uring · SD '26