STRUCT BLK_MQ_TAG_SET(9)
β¨ 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 morectx -> hctxmappings. 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 themaparray. 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 forBLK_MQ_REQ_RESERVEDtag 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 moreBLK_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. hasnr_hw_queueselements.shared_tagsβ shared set of tags. hasnr_hw_queueselements. if set, shared by all tags.tag_list_lockβ serializestag_listaccesses.tag_listβ list of the request queues that use this tag set. see alsorequest_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 tagspage_listto prevent use-after-free when iterating tags. safety first, bestie π«Άupdate_nr_hwq_lockβ synchronize updatingnr_hw_queueswith 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:
enum blk_eh_timer_return(9)struct blk_mq_hw_ctx(9)struct blk_mq_queue_map(9)enum hctx_type(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)
mwah π this page came from ./include/linux and it's dated October 2026 β slay forever πβ¨
π¦ 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