﻿# Keep io_uring completion pressure separate from NVMe queue depth

Inspect io_uring features and completion ownership before treating ring pressure as NVMe loss or increasing submission depth.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/guide-storage-io-uring-cq-overflow/
Language: en

An asynchronous loader stops making progress while the storage device remains responsive. Its userspace completion ring may be full because the application is not consuming results promptly. That queue is different from the NVMe controller's hardware queue. Increasing submitted work can worsen the mismatch between completion production and application draining rather than repair the actual bottleneck.

## Record the ring contract

Preserve setup parameters, returned submission and completion capacities, feature bits and kernel context. Requested entries are not a substitute for the actual configured ring. In particular, inspect whether the kernel reports the documented no-drop feature. Do not infer behavior from a library version alone: the running kernel supplies capabilities and error semantics that determine how a full completion queue is handled.

## Separate fullness from lost events

With the documented no-drop support, a full ring can lead the kernel to retain completions internally until userspace makes room. That is different from declaring every overflow condition a lost I/O. Critical memory exhaustion remains an exceptional failure case with documented reporting. Preserve the distinction among visible ring occupancy, deferred completions and evidence that a completion was actually dropped.

## Drain and release ownership

Retrieving a completion and marking its slot consumed are separate API actions. The application must preserve the result and associated request identity before releasing the slot for reuse. Holding onto a pointer after its slot can be reused risks reading another result. Define which thread owns draining and result transfer rather than allowing several consumers to assume the same completion remains available.

## Interpret submission errors in context

The enter interface documents errors associated with pending overflow entries and unreaped completions. Record the exact call, flags and outcome instead of converting every error into a failed disk read. A request's completion result also has its own operation outcome. Recovery must reconcile accepted submissions and observed completions before replaying work or freeing buffers still associated with outstanding operations.

## Verify bounded progress

In an isolated harness, pause the consumer, observe ring pressure, resume draining and check that every accepted request reaches a reconciled outcome. Include failure handling for uncertain completion delivery. A useful diagnosis explains the userspace consumption boundary. It does not identify SSD media damage, establish a universal safe queue depth or guarantee that retaining more asynchronous work lowers actual model-loading readiness time.

## Primary references

[Linux io_uring Setup Features and Completion Capacity](https://man7.org/linux/man-pages/man2/io_uring_setup.2.html).

[Linux io_uring Submission and Completion Errors](https://man7.org/linux/man-pages/man2/io_uring_enter.2.html).

[liburing Completion Consumption](https://man7.org/linux/man-pages/man3/io_uring_cqe_seen.3.html).

Related reading: [LLM loading: read-latency tails beyond one SSD speed](/journal/nvme-read-latency-model-load/); [OS page cache and cold model loading: what to record](/journal/model-load-os-page-cache/).
