STRUCT BLK_MQ_CTX(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct blk_mq_ctx(9) πŸ’…

okay so this is from the Kernel API Manual, bestie β€” deep lore from the block layer, and you're gonna get it, i promise 🫢


✨ NAME ✨

struct blk_mq_ctx β€” the state for a software queue that faces the submitting CPUs πŸ’«

like, that's literally its whole job description. software queue. facing the CPUs that submit. state. that's the vibe πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole shape of it, character for character, no cap:

struct blk_mq_ctx {
    struct {
      spinlock_t lock;
      struct list_head        rq_lists[HCTX_MAX_TYPES];
    };
    unsigned int            cpu;
    unsigned short          index_hw[HCTX_MAX_TYPES];
    struct blk_mq_hw_ctx    *hctxs[HCTX_MAX_TYPES];
    struct request_queue    *queue;
    struct blk_mq_ctxs      *ctxs;
    struct kobject          kobj;
 };

look at that anonymous little nested struct just vibing at the top with its lock and its rq_lists[HCTX_MAX_TYPES] β€” main character energy fr fr 🌸


πŸŽ€ Members πŸŽ€

  • {unnamed_struct} β€” anonymous πŸ™ˆ that's it, that's the entry. it's anonymous, it has no name, it simply is. iconic.

πŸ”₯ SEE ALSO πŸ”₯

  • the kernel file ./block/blk-mq.h β€” go read it, iykyk πŸ‘‘

ngl bestie, everything you need is right here in this struct β€” don't go inventing extra fields, the source of truth is the source 🧚

that's the whole page!! πŸ“ and for the receipts: it comes to you from ./block, dated October 2026, and the page is struct blk_mq_ctx(9). slay, go touch some block layer βœ¨πŸ’œ

πŸ“¦ where this page comes from