Operations 10 min read

Evolution and Mechanisms of Linux I/O Schedulers (Kyber, MQ‑Deadline, BFQ)

From legacy spinning-disk optimizations to modern SSD-focused QoS, Linux’s I/O scheduler landscape has evolved through noop, deadline, cfq and now multiqueue designs such as Kyber, MQ-Deadline, and BFQ, each employing distinct latency, deadline, and budget-fairness algorithms, supporting cgroup/ionice priorities, and complemented by numerous experimental out-of-tree implementations.

OPPO Kernel Craftsman
OPPO Kernel Craftsman
OPPO Kernel Craftsman
Evolution and Mechanisms of Linux I/O Schedulers (Kyber, MQ‑Deadline, BFQ)

The article introduces the concept of I/O schedulers, explaining that traditional spinning disks required head‑movement optimization, while modern SSDs use logical block addresses (LBA) and therefore rely on QoS‑oriented scheduling.

It lists the historical and current Linux block‑layer schedulers, highlighting the mainline ones (noop, deadline, cfq, mq‑deadline, bfq, kyber) and several experimental or out‑of‑tree schedulers (SIO, VR, Row, Zen, Maple, FIO).

Kernel 6.1 community schedulers

Kyber – introduced in 2017, classifies I/O into types (read, write, discard, other) and controls latency per type. It uses four scheduling domains, each with a bitmap indicating resource usage. The scheduler measures per‑request latency (KYBER_IO_LATENCY) and total latency (KYBER_TOTAL_LATENCY) to adjust queue depth and batch size.

MQ‑Deadline – a multiqueue version of the classic deadline scheduler. Requests are inserted into both a sorted RB‑tree (by sector) and a FIFO queue. Expired requests are dispatched first; otherwise, dispatch follows priority and a 2:1 read‑to‑write ratio, with separate deadlines for reads and writes.

BFQ (Budget Fair Queueing) – derived from CFQ, BFQ allocates a budget (maximum sectors) per thread and aims for bandwidth‑fairness. It tracks a virtual time (vtime) per thread, selects the smallest vtime for dispatch, and dynamically adjusts weights based on thread type (interactive, background, newly created, etc.).

The article also covers cgroup/ionice integration: certain schedulers support I/O priority and cgroup weight settings. Example commands are shown:

usage: ionice [-t] [-c CLASS] [-n LEVEL] [COMMAND...|-p PID]

and a kernel structure example:

struct deadline_data *dd = q->elevator->elevator_data;

It presents performance comparisons between idle and real‑time (RT) bandwidth, and provides configuration examples for blkio weight and io.max.

Finally, the article lists several out‑of‑tree scheduler implementations (VR, SIO, Row, Zen, Maple, etc.) with GitHub links, and cites reference documentation such as the Linux kernel block documentation and BFQ tutorials.

LinuxcgroupBFQI/O schedulerKybermq-deadline
OPPO Kernel Craftsman
Written by

OPPO Kernel Craftsman

Sharing Linux kernel-related cutting-edge technology, technical articles, technical news, and curated tutorials

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.