Io Uring logo

Io Uring

Community
mohitmishra786
io-uring

io_uring skill for Linux async I/O. Use when building high-performance servers with liburing, multi-shot operations, provided buffers, fixed files, zero-copy send, or tokio-uring. Activates on queries about io_uring, SQE/CQE, liburing, IORING_OP_PROVIDE_BUFFERS, or io_uring vs epoll.

Overview

Publishermohitmishra786
Repositorylow-level-dev-skills
Skill nameio-uring
Stars
266
Forks
31
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by mohitmishra786 on GitHub. Read the source before you install it.

Installation

Install the Io Uring AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/mohitmishra786/low-level-dev-skills/tree/main/skills/async-io/io-uring
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git /tmp/low-level-dev-skills
mkdir -p .claude/skills
cp -r /tmp/low-level-dev-skills/skills/async-io/io-uring .claude/skills/io-uring
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Io Uring in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Io Uring on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Io Uring is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

io_uring

Purpose

Guide agents through Linux io_uring: the submission/completion queue model (SQE/CQE), liburing API, multi-shot accept/recv, provided buffer rings, fixed files and registered buffers, zero-copy send, Rust integration with tokio-uring, performance comparison with epoll, and security considerations.

When to Use

  • Building a high-throughput network or disk server on Linux 5.1+
  • Replacing epoll + thread pool with fewer syscalls
  • Implementing multi-shot accept/recv for connection-heavy services
  • Using zero-copy networking with IORING_OP_SEND_ZC
  • Integrating async I/O in Rust via tokio-uring
  • Evaluating io_uring vs epoll for your workload

Workflow

1. SQ/CQ model

Application                    Kernel
    │                            │
    ├── mmap SQ ring ───────────►│ submission queue (SQE)
    ├── mmap CQ ring ◄──────────│ completion queue (CQE)
    ├── io_uring_submit() ──────►│ processes SQEs
    └── io_uring_wait_cqe() ◄──│ posts CQEs

Each SQE describes one operation; each CQE reports result and user_data cookie.

2. Minimal liburing example

c
#include <liburing.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>

int main(void) {
    struct io_uring ring;
    io_uring_queue_init(32, &ring, 0);

    int fd = open("test.txt", O_RDONLY);
    char buf[4096];

    struct io_uring_sqe *sqe = io_uring_get_sqe(&ring);
    io_uring_prep_read(sqe, fd, buf, sizeof(buf), 0);
    io_uring_sqe_set_data(sqe, (void *)1);

    io_uring_submit(&ring);

    struct io_uring_cqe *cqe;
    io_uring_wait_cqe(&ring, &cqe);
    if (cqe->res >= 0)
        printf("read %d bytes\n", cqe->res);
    else
        perror("read");

    io_uring_cqe_seen(&ring, cqe);
    io_uring_queue_exit(&ring);
    close(fd);
    return 0;
}
bash
gcc -o uring_read uring_read.c -luring
./uring_read

3. Common prep operations

FunctionOperation
io_uring_prep_readFile read
io_uring_prep_writeFile write
io_uring_prep_recvSocket recv
io_uring_prep_sendSocket send
io_uring_prep_acceptAccept connection
io_uring_prep_connectOutbound connect
io_uring_prep_poll_addPoll fd
io_uring_prep_timeoutTimeout/link timeout
c
// Batch multiple SQEs before single submit
for (int i = 0; i < n; i++) {
    sqe = io_uring_get_sqe(&ring);
    io_uring_prep_read(sqe, fds[i], bufs[i], sizes[i], 0);
    io_uring_sqe_set_data(sqe, (void *)(intptr_t)i);
}
io_uring_submit(&ring);

4. Multi-shot operations

c
// Multi-shot accept — one SQE handles many connections
sqe = io_uring_get_sqe(&ring);
io_uring_prep_multishot_accept(sqe, listen_fd, NULL, NULL, 0);
io_uring_sqe_set_data(sqe, (void *)ACCEPT_COOKIE);

// Loop on CQEs until CQE_FLAG_MORE is clear
while (1) {
    io_uring_wait_cqe(&ring, &cqe);
    if (cqe->user_data == ACCEPT_COOKIE) {
        int client_fd = cqe->res;
        if (client_fd >= 0)
            handle_client(client_fd);
        if (!(cqe->flags & IORING_CQE_F_MORE))
            break;  // re-arm accept SQE
    }
    io_uring_cqe_seen(&ring, cqe);
}

5. Provided buffer rings

c
#include <liburing.h>

#define BUF_GROUP 0
#define BUF_SIZE  4096
#define BUF_COUNT 64

struct io_uring_buf_ring *buf_ring;
char bufs[BUF_COUNT][BUF_SIZE];

// Setup buffer ring
buf_ring = io_uring_setup_buf_ring(&ring, BUF_COUNT, BUF_GROUP, 0, &ret);
for (int i = 0; i < BUF_COUNT; i++)
    io_uring_buf_ring_add(buf_ring, bufs[i], BUF_SIZE, i, BUF_COUNT - 1 - i, 0);
io_uring_buf_ring_advance(buf_ring, BUF_COUNT);

// Recv with provided buffers
sqe = io_uring_get_sqe(&ring);
io_uring_prep_recv_multishot(sqe, sock_fd, NULL, 0, 0);
sqe->buf_group = BUF_GROUP;

Kernel selects buffer from ring — eliminates per-recv buffer allocation.

6. Fixed files and registered buffers

c
// Register files — avoids per-op fd table lookup
int fds[64];
io_uring_register_files(&ring, fds, 64);
io_uring_prep_read(sqe, 0, buf, size, offset);  // index 0, not fd

// Registered buffers — pinned, DMA-friendly
struct iovec iov = { .iov_base = buf, .iov_len = size };
io_uring_register_buffers(&ring, &iov, 1);
io_uring_prep_read_fixed(sqe, fd, buf, size, offset, 0);

7. Zero-copy send

c
sqe = io_uring_get_sqe(&ring);
io_uring_prep_send_zc(sqe, sock_fd, data, len, 0, 0);
// May complete with IORING_CQE_F_MORE — wait for notification CQE

Requires kernel 6.0+, NIC/driver support. Falls back to copy mode if unavailable.

8. tokio-uring (Rust)

rust
use tokio_uring::fs::File;

#[tokio_uring::main]
async fn main() -> std::io::Result<()> {
    let file = File::open("test.txt").await?;
    let buf = vec![0u8; 4096];
    let (res, buf) = file.read_at(buf, 0).await;
    println!("read {} bytes", res?);
    Ok(())
}
bash
cargo add tokio-uring

9. io_uring vs epoll

Aspectepollio_uring
Syscallsepoll_wait + read/write per opBatch SQEs, single submit
Buffer mgmtApp allocatesProvided buffers
Zero-copysendfile, manualSEND_ZC built-in
ComplexityLowerHigher
Kernel version2.6+5.1+ (features vary)
Choose io_uring when
├── Syscall overhead is measurable bottleneck
├── High connection count with multi-shot
└── Kernel 6.x+ with needed op support

Stay on epoll when
├── Simple app, portability matters
└── Team familiarity outweighs gains

10. Security considerations

bash
# Restrict unprivileged io_uring (some distros disable by default)
sysctl kernel.io_uring_disabled   # 0=enabled, 1=disabled, 2=allow registered
sysctl kernel.io_uring_group      # gid allowed when disabled=2

io_uring has been an attack surface — keep kernels patched; sandbox untrusted code.

Common Problems

SymptomCauseFix
-EINVAL on prepOp not supported on kernelCheck io_uring_get_probe()
Hang on wait_cqeMissing submitCall io_uring_submit after SQEs
Buffer not returnedProvided buffer not re-addedbuf_ring_add after consuming
SEND_ZC incompleteNeed second CQEWait for IORING_CQE_F_MORE clear
Slower than epollSmall batch sizeBatch more SQEs; use SQPOLL
Permission deniedio_uring disabledsysctl or run with capability

Related Skills

  • skills/async-io/dpdk — kernel bypass alternative for networking
  • skills/async-io/af-xdp — XDP socket path for packet I/O
  • skills/observability/ebpf — trace io_uring events
  • skills/rust/rust-async-internals — async model behind tokio-uring
  • skills/profilers/strace-ltrace — syscall comparison vs epoll
  • skills/kernel/kernel-internals — kernel I/O subsystem context

Frequently asked questions

What does the Io Uring AI skill do?

io_uring skill for Linux async I/O. Use when building high-performance servers with liburing, multi-shot operations, provided buffers, fixed files, zero-copy send, or tokio-uring. Activates on queries about io_uring, SQE/CQE, liburing, IORING_OP_PROVIDE_BUFFERS, or io_uring vs epoll.

Why use Io Uring on TypingMind?

Because you install it once and use it with any model. Io Uring is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Io Uring in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/mohitmishra786/low-level-dev-skills/tree/main/skills/async-io/io-uring. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Io Uring?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Io Uring?

As many as you like. As long as a model supports skills, you can use Io Uring with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Io Uring AI skill free?

Yes. It is published on GitHub by mohitmishra786 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇