Skip to content

io: registered files and fixed buffers on io_uring #125

Open

Description

@lexoliu

Problem

Each io_uring operation on the compio backend resolves its file descriptor and maps its buffer again, though a connection's socket and buffers live as long as the connection.

Scope

On Linux the compio backend registers each connection's socket in the ring's file table and does reads and writes into registered (fixed) buffers, falling back only for a descriptor the table has no room for.

Done when

Socket I/O on the compio backend uses registered files and fixed buffers on Linux, with the existing I/O tests passing.

Activity

  1. lexoliu commented on Nov 11, 2026

    @lexoliu
    CollaboratorAuthor

    Fixed buffers save per-operation page pinning, which only a zero-copy send pays: plain send/recv accept IORING_RECVSEND_FIXED_BUF only since 57ed21fad402 (June 2026), and before that only SEND_ZC honours it (io_uring/net.c). So the fixed-buffer half targets buffers the stack owns and sends zero-copy (relay buffers, outboxes) from a per-thread registered arena, alongside #126; application Bytes are not copied into it. Registered files still apply to every socket operation: the gain is the file refcount per operation, with the ordinary fd kept for kernel TLS setsockopt, getpeername and splice.

  2. lexoliu commented on Nov 11, 2026

    @lexoliu
    CollaboratorAuthor

    The registered-files half is in #153. The fixed-buffer half has no consumer in this repository yet: h1 sends its outbox (application Bytes plus the head) in one call, and user-mode TLS sends ciphertext with a copying write. Its consumers are the proxy relay buffers in zenwave and skyzen. compio (0.12.5, and 0.13.0-beta.1) can't register buffers and doesn't expose the submitter, so a registered arena needs an upstream change first. Once those exist, zero_copy::send<T: OpCode> takes a fixed-buffer send as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:ioRuntime-neutral I/OenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions