NVMe storage can deliver high throughput by exposing a drive’s internal parallelism to the operating system. That advantage also creates a challenge for time-sensitive workloads: when many requests are in flight, a latency-sensitive read may wait behind background work already handed to the device. NVMe I/O scheduling therefore involves more than choosing which request goes next. It also means deciding how much work the drive can see at once.
The K2 scheduler was designed to address this problem on Linux. Its approach, called work-constraining scheduling, limits the total number of requests in NVMe queues. By keeping some background requests in software staging queues, K2 aims to reduce high-percentile latency for prioritized work while retaining useful device throughput.
Why NVMe changes the scheduling problem
Earlier storage devices often had less parallelism, or had mechanical delays that made software request ordering an important way to improve performance. NVMe SSDs present a different model. Multiple queues allow requests to be processed concurrently, and the drive’s controller decides how to execute the work it receives. Once requests have entered device queues, the operating system has less ability to control their order or influence which application’s work is served first.
Linux’s multi-queue block layer is designed to support high request rates while limiting cross-core coordination. Requests may be staged, merged, and passed through driver buffers to NVMe queues. This architecture helps performance, but it complicates global policies that need to distinguish between workloads with different timing priorities.
In the study’s tests, existing Linux schedulers generally did not isolate latency-sensitive traffic from competing background load. As background throughput rose, the 99.9th-percentile latency of real-time requests could increase substantially, particularly for reads. This tail latency matters because a good median does not prevent a small fraction of requests from taking much longer.
How work-constraining NVMe I/O scheduling works
Conventional work-conserving scheduling tends to keep the device supplied with requests whenever work is available. More in-flight requests can help the drive exploit parallelism and increase throughput. But deep queues also leave more competing work for the device to arbitrate, potentially delaying a higher-priority request.
K2 takes a different approach: it limits the work visible to the drive. The scheduler maintains separate staging queues for Linux real-time I/O priority levels, plus a queue for non-real-time requests. When it promotes work, it selects from the highest-priority non-empty queue. It stops promoting requests when the configured limit on total in-flight NVMe requests has been reached. A request completion frees a slot, allowing K2 to consider the next queued request.
This limit applies across the device’s NVMe queues, rather than independently to each one. As a result, K2 can constrain the overall amount of work competing inside the drive. The queue bound is a tuning control: a lower bound can provide stronger latency protection, while a higher bound gives the device more work to process in parallel and may preserve more throughput.
What the evaluation shows
In the reported evaluation, K2 was tested as a Linux kernel module on a specific NVMe SSD and system, using microbenchmarks with real-time and background workloads. The results show why queue depth can be a useful control for balancing latency and throughput, but they should not be treated as universal performance guarantees.
For a random-read workload with 64 KiB blocks, the study reports that the 99.9th-percentile latency reached up to 14 ms with the Linux NONE policy. With K2’s limit set to eight in-flight requests, that figure fell to about 2.5 ms in the tested configuration. Background throughput also declined, illustrating the trade-off rather than eliminating it. Across the paper’s reported workloads, the abstract summarizes reductions of up to 10 times for read latency and 6.8 times for write latency at the 99.9th percentile, with a maximum background-throughput penalty of 2.7 times.
The effect depends on the workload. The study found that writes could remain fast while the drive’s write cache had capacity; when the cache was exceeded, latency rose sharply. Random reads were a particularly challenging case for real-time scheduling. These observations reinforce the importance of evaluating the storage device under the actual access patterns and drive conditions expected in operation.
Practical considerations for automation systems
For system integrators and plant teams considering NVMe storage for data-driven systems, K2 illustrates a scheduling principle: limiting device queue depth can improve the responsiveness of priority traffic, but this protection consumes some of the parallelism that supports peak throughput.
- Define the priority relationship. Identify which I/O requests are time-sensitive and which can tolerate delay. K2 uses Linux I/O priorities to separate these classes.
- Measure tail latency. Assess high-percentile request times alongside average latency and throughput. Averages alone may obscure delays that matter to control, telemetry, or other responsive applications.
- Tune the queue bound against workload needs. A smaller in-flight limit emphasizes latency protection; a larger limit can support higher throughput. Testing should reflect expected request sizes and read/write patterns.
- Distinguish latency control from hard guarantees. K2 constrains the work submitted to an off-the-shelf drive; it does not control the drive’s internal execution or prevent every source of delay.
The research explicitly limits its claims to empirical results. Drive-internal behavior, including error correction and the possibility of failed reads, remains outside the scheduler’s control. Accordingly, the approach should not be interpreted as a substitute for the reliability and assurance measures required in safety-critical applications.
Conclusion
NVMe’s parallel queues raise a practical scheduling question: how much work should the operating system expose to the drive when latency-sensitive and background workloads share storage? K2 answers by constraining the total in-flight request count and prioritizing requests before they enter device queues. Its results demonstrate a configurable trade-off between background throughput and tail latency. For industrial automation teams, the key implication is to evaluate storage scheduling as part of the complete workload and to treat empirical latency improvements as evidence to validate—not as hard real-time guarantees.