STRUCT BLK_MQ_QUEUE_MAP(9)
π 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 withnr_cpu_idselements, 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:
enum blk_eh_timer_return(9)struct blk_mq_hw_ctx(9)enum hctx_type(9)struct blk_mq_tag_set(9)struct blk_mq_queue_data(9)struct blk_mq_ops(9)blk_mq_rq_state(9)blk_mq_add_to_batch(9)blk_mq_rq_from_pdu(9)blk_mq_rq_to_pdu(9)blk_rq_nr_bvec(9)blk_rq_passthrough_stats(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms