Skip to content

io: consume the receive buffer ring incrementally on io_uring #163

Closed

Description

@lexoliu

Problem

A multishot receive consumes a whole provided buffer per completion, however few bytes arrived, so a ring sized for a thread's connections runs out after that many small reads. With incremental consumption (IOU_PBUF_RING_INC, Linux 6.12) the kernel keeps filling a buffer until it is full and marks each completion that leaves it in use with IORING_CQE_F_BUF_MORE. compio 0.19 neither registers its pool with that flag nor reports BUF_MORE, and its BufferPool returns a buffer to the ring on every completion, which is wrong under incremental consumption.

Scope

Receive on Linux through an incrementally consumed ring, on a branch of compio that reports BUF_MORE (compio-rs/compio#1142) and recycles a buffer only once the kernel is done with it, depended on by git. Kernels before 6.12 keep whole-buffer consumption.

Done when

On a kernel with incremental consumption, consecutive small reads of one connection share a buffer, as a test asserts, and the existing receive tests pass on both paths.

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