STRUCT BLK_MQ_TAG_SET(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay so bestie, welcome to the struct blk_mq_tag_set(9) page from the Kernel API Manual πŸ’– and the whole vibe is literally a tag set that can be shared between request queues. that's the name, that's the energy, periodt πŸ’…


🌸 SYNOPSIS 🌸

struct blk_mq_tag_set {
    const struct blk_mq_ops *ops;
    struct blk_mq_queue_map map[HCTX_MAX_TYPES];
    unsigned int            nr_maps;
    unsigned int            nr_hw_queues;
    unsigned int            queue_depth;
    unsigned int            reserved_tags;
    unsigned int            cmd_size;
    int numa_node;
    unsigned int            timeout;
    unsigned int            flags;
    void *driver_data;
    struct blk_mq_tags      **tags;
    struct blk_mq_tags      *shared_tags;
    struct mutex            tag_list_lock;
    struct list_head        tag_list;
    struct srcu_struct      *srcu;
    struct srcu_struct      tags_srcu;
    struct rw_semaphore     update_nr_hwq_lock;
 };

πŸŽ€ Members πŸŽ€

here's the member-by-member tour, no skips, no cap 🫢

  • ops β€” pointers to functions that implement block driver behavior. literally the driver's whole move set.
  • map β€” one or more ctx -> hctx mappings. one map exists for each hardware queue type (enum hctx_type) that the driver wishes to support. there are no restrictions on maps being of the same size, and it's perfectly legal to share maps between types β€” no cap.
  • nr_maps β€” number of elements in the map array. a number in the range [1, HCTX_MAX_TYPES], fr fr.
  • nr_hw_queues β€” number of hardware queues supported by the block driver that owns this data structure.
  • queue_depth β€” number of tags per hardware queue, reserved tags included.
  • reserved_tags β€” number of tags to set aside for BLK_MQ_REQ_RESERVED tag allocations.
  • cmd_size β€” number of additional bytes to allocate per request. the block driver owns these additional bytes.
  • numa_node β€” NUMA node the storage adapter has been connected to.
  • timeout β€” request processing timeout in jiffies.
  • flags β€” zero or more BLK_MQ_F_* flags.
  • driver_data β€” pointer to data owned by the block driver that created this tag set.
  • tags β€” tag sets. one tag set per hardware queue. has nr_hw_queues elements.
  • shared_tags β€” shared set of tags. has nr_hw_queues elements. if set, shared by all tags.
  • tag_list_lock β€” serializes tag_list accesses.
  • tag_list β€” list of the request queues that use this tag set. see also request_queue.tag_set_list.
  • srcu β€” use as lock when type of the request queue is blocking (BLK_MQ_F_BLOCKING).
  • tags_srcu β€” SRCU used to defer freeing of tags page_list to prevent use-after-free when iterating tags. safety first, bestie 🫢
  • update_nr_hwq_lock β€” synchronize updating nr_hw_queues with add/del disk & switching elevator.

πŸ’… SEE ALSO πŸ’…

kernel file ./include/linux/blk-mq.h is the main character here, and you also gotta peek at:

mwah πŸ’‹ this page came from ./include/linux and it's dated October 2026 β€” slay forever 🌈✨

πŸ“¦ where this page comes from