STRUCT BLK_MQ_QUEUE_MAP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct blk_mq_queue_map(9) β€” like, the kernel API manual, bestie

okay so real talk β€” you're looking at struct blk_mq_queue_map(9) from the Kernel API Manual, and honestly? it's giving "small struct, big responsibilities." it's literally the thing that maps your software queues onto hardware queues, and i'm obsessed. let's get into it 🫢


✨ NAME ✨

struct blk_mq_queue_map β€” Map software queues to hardware queues πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

struct blk_mq_queue_map {
    unsigned int *mq_map;
    unsigned int nr_queues;
    unsigned int queue_offset;
 };

no cap, that's the whole struct. three members, iconic behavior. πŸ’…


πŸŽ€ Members πŸŽ€

  • mq_map β€” bestie this is THE map. it's your CPU ID β†’ hardware queue index map, an array with nr_cpu_ids elements, and every single element holds a value in the range [queue_offset, queue_offset + nr_queues). so like, each CPU gets pointed at a hardware queue, and the range is non-negotiable. periodt. 🌈
  • nr_queues β€” the number of hardware queues we're mapping CPU IDs onto. that's it, that's the girl. ✨
  • queue_offset β€” the first hardware queue we map onto. and the lore here?? the PCIe NVMe driver uses this to map each hardware queue type (enum hctx_type) onto a distinct set of hardware queues. so it's not just an offset, it's an offset with main character energy. πŸ‘‘

🌸 SEE ALSO 🌸

the kernel file ./include/linux/blk-mq.h, plus the whole friend group:


lowkey a reminder: this page lives under ./include/linux in the source tree, so if you're hunting for it irl, that's the vibe check location πŸ“

and that's the page, bestie!! sourced straight from ./include/linux, dated October 2026, and yes the footer still says struct blk_mq_queue_map(9) β€” slay, we love a consistent queen. go map some queues πŸ’œπŸ§šβ€β™€οΈπŸ”₯

πŸ“¦ where this page comes from