Budget Fair Queueing (BFQ)
Budget Fair Queueing is a Linux I/O scheduler that uses weighted queues and sector budgets to distribute storage service.
BFQ budgets count sectors rather than a fixed service time. Weights apportion bandwidth within an I/O-priority class, while classes have distinct priorities. It can switch to time-based sharing to limit throughput loss. [1]
With low_latency enabled, selected interactive and soft-real-time workloads receive raised weights. Configured weights alone therefore do not predict the observed bandwidth ratio. Idling and strict service settings also change the throughput and latency trade-off. [1]
In v6.16, strict_guarantees stops ordinary dispatch while tot_rq_in_driver is nonzero. Requests on the separate dispatch list are handled before that check, so it is not a universal queue-depth-one invariant. The reduced parallelism can lower throughput. [2]
The documentation reports about 1.9 µs of single-lock-protected processing per request on a dated notebook CPU, against 0.7 µs for mq-deadline, and this overhead limits the request rate a CPU can sustain. fifo_expire_sync defaults to 125 ms and fifo_expire_async to 250 ms. [1]
Idling can preserve a synchronous queue's service share while its next request is still being prepared. On flash with internal command queueing, this can trade throughput for fairness or latency. [1] With strict_guarantees disabled, slice_idle=0 disables idling. Enabling strict_guarantees from zero raises any shorter interval to 8 ms. [2]
Later slice_idle or slice_idle_us writes can lower that stored interval. Rewriting strict_guarantees=1 while already enabled does not clamp it again. The strict-mode branch precedes the zero-interval check, so a zero readback does not establish disabled idling. Record setter order and final values; the stored interval is not every actual wait duration. [2]
Relations
- related
- I/O scheduler, Linux blk-mq, Inter-flow interference, Slowdown fairness, cgroup v2 I/O controller, Anticipatory scheduling, Work-conserving scheduler
Advantages
- Setting low_latency to 0 switches off the latency heuristics for a device whose only goal is maximum throughput. [1]
- Group weights from 1 to 1000, with a default of 100, are set through io.bfq.weight in cgroup v2 or blkio.bfq.weight in cgroup v1. [1]
Limitations
- Enabling CONFIG_BFQ_CGROUP_DEBUG lowers the sustainable request rate because the blkio.bfq statistics are created and updated. [1]
- The default configuration favors latency over throughput, so its schedules can deliver lower throughput. [1]
- In v6.16, slice_idle uses integer division: setting slice_idle_us to 500 reads back as 0 milliseconds and 500 microseconds, even with strict_guarantees disabled. Neither readback measures an actual wait; inspect the microsecond value. [2]
Citations
- Linux 6.16: BFQ, budgets, priority classes and low_latency
- Linux v6.16: bfq-iosched.c, bfq_better_to_idle, bfq_strict_guarantees_store and __bfq_dispatch_request
Further reading
Sources & caveats
- bfq is the Linux 6.16 BFQ documentation, re-read for default tunables, cgroup weights and the published per-request overhead figures.
- bfq-source is the v6.16 bfq-iosched.c source, re-read on git.kernel.org at the same tag for the dispatch-list and tot_rq_in_driver checks.
- The inter-flow-interference entry links here because BFQ weights and budgets shape how concurrent flows share one device.