blk_mq_unique_tag(9)
β¨ blk_mq_unique_tag(9) β¨
okay so bestie, welcome to the Kernel API Manual π
this one's a lil function called blk_mq_unique_tag and honestly? it's giving "tiny function, big responsibility." let's get into it π«Ά
πΈ NAME πΈ
blk_mq_unique_tag β return a tag that is unique queue-wide π
π¦ SYNOPSIS π¦
u32 blk_mq_unique_tag (struct request *rq );
β ARGUMENTS β
rqβ the request you want a unique tag computed for, like "here's my request, pls give me a tag bestie" π
π DESCRIPTION π
Okay so here's the vibe check π the tag field inside struct request is unique per hardware queue, but not across all hardware queues β which is lowkey a problem if you need a tag that's actually unique everywhere, y'know? π
So this function exists fr fr: it returns a tag where the hardware context index lives in the upper bits and the per hardware queue tag sits in the lower bits. Upper bits + lower bits = one iconic, queue-wide unique tag periodt π β¨
π NOTE π
Heads up bestie π«Ά when you call this for a request that's queued on a non-multiqueue request queue, the hardware context index gets set to zero. No cap, that's just how it is π
π SEE ALSO π
Kernel file ./block/blk-mq-tag.c plus all these besties:
bt_for_each(9)bt_tags_for_each(9)blk_mq_all_tag_iter(9)blk_mq_tagset_busy_iter(9)blk_mq_tagset_wait_completed_request(9)blk_mq_queue_tag_busy_iter(9)
and that's the whole page, you ate that ππ this lil gem lives under ./block in the source, dated October 2026, and it's part of the blk_mq_unique_tag(9) manual β go forth and tag things uniquely, queen ππ
π¦ 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