blk-mq · shipping · also Multi-Queue Block I/O

Linux blk-mq

Linux blk-mq is the block-layer mechanism that stages and dispatches I/O through multiple software and hardware queues.

Related Observatory article: Read on hesela.com

Software staging can support merging and I/O scheduling before requests reach hardware dispatch queues. Selecting the none scheduler does not bypass the complete kernel block layer. [1]

Staging queues are defined per CPU or per node, each with its own lock. The number of hardware dispatch queues follows the hardware contexts of the device and driver but does not exceed the number of cores. Requests that cannot be sent immediately wait on a dispatch list served first on the next queue run. [1]

Queue topology alone does not provide a per-application latency guarantee. Neither the block layer nor the device protocol guarantees completion order, so higher layers must enforce required dependencies. [1]

Linux v6.16 can attempt plug merging and request-QoS throttling before scheduler insertion. These operations can remain with none selected. A plug is flushed at 32 requests, or 64 across multiple queues, or when its last request reaches 128 KiB on a merging queue. mq-deadline shares sorting and FIFO state across its hardware queues. [3] [5] [4]

Tag allocation is distinct from dispatch. In Linux v6.16, scheduler-tagged requests initially have internal_tag but no driver tag; without a scheduler, tag is assigned at allocation. The request timer starts in blk_mq_start_request, not merely when a tag exists. [3]

Relations

related
NVMe, Queue depth, Inter-flow interference, io_uring, I/O scheduler, mq-deadline, Budget Fair Queueing (BFQ), Kyber I/O scheduler, blk-mq request tag, Head-of-line blocking

Advantages

  • CPU-local submission entry points remove the single shared queue lock that limited scaling on multiprocessor systems. [1]

Limitations

  • Merging adjacent sectors happens in staging, and there is no reordering at the hardware dispatch stage. [1]

Citations

  1. Linux kernel documentation: Multi-Queue Block IO Queueing Mechanism, operation, schedulers and hardware dispatch queues. (accessed 2026-10-23)
  2. Linux v6.16: blk-mq.c, blk_mq_submit_bio (accessed 2026-11-08)
  3. Linux v6.16: mq-deadline.c, soft expirations and dd_dispatch_request (accessed 2026-10-23)
  4. Linux v6.16: block/blk.h, BLK_MAX_REQUEST_COUNT and BLK_PLUG_FLUSH_SIZE (accessed 2026-10-23)

Further reading

  1. Hesela: Sharing an SSD: who pays for the slowdown? (accessed 2026-10-20)
Sources & caveats
  • blk-mq is the Linux 6.16 multi-queue block I/O page, re-read for staging queues, hardware queue counts and the dispatch list.
  • blk-h is the v6.16 block/blk.h header, read for BLK_MAX_REQUEST_COUNT and BLK_PLUG_FLUSH_SIZE.
  • blk-source and deadline are the v6.16 blk-mq.c and mq-deadline.c sources, re-read on git.kernel.org at the same tag.
  • The io-request-size entry links here because plug merging can turn several submitted requests into one larger device request.

JSON: /data/terms/blk-mq.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Linux blk-mq. Hesela. 2026-11-19. https://hesela.dev/terms/blk-mq/