Skip to content

Commit

Permalink
what is io_uring?
Browse files Browse the repository at this point in the history
  • Loading branch information
matklad committed Sep 23, 2024
1 parent 7382ff6 commit 4872972
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions content/posts/2024-09-32--what-is-io-uring.dj
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# What is io_uring?

An attempt at concise explanation of what io_uring is.

`io_uring` is a new Linux kernel interface for making system calls.
Traditionally, syscalls are submitted to the kernel *individually* and
*synchronously*: a syscall CPU instruction transfers control from the
application to the kernel; control returns to the application only when the
syscall is completed. In contrast, `io_uring` is a *batched* and *asynchronous*
interface. The application submits several syscalls by writing their codes &
arguments to a lock-free shared-memory ring buffer. The kernel reads the
syscalls from this shared memory and executes them at its own pace. To
communicate results back to the application, the kernel writes the results to a
second lock-free shared-memory ring buffer, where they become available to the
application asynchronously.

You might want to use `io_uring` if:

- you need extra performance unlocked by amortizing userspace/kernelspace
context switching across entire batches of syscalls,
- you want a unified asynchronous interface to the entire system.

You might want to avoid `io_uring` if:

- you need to write portable software,
- you want to use only old, proven features,
- and in particular you want to use features with a good security track record.

0 comments on commit 4872972

Please sign in to comment.