All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lei Chen <lei.chen@smartx.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	Lei Chen <lei.chen@smartx.com>
Subject: [PATCH v1 4/4] block: link request queue debugfs directories to tag sets
Date: Fri,  9 Oct 2026 11:01:11 +0800	[thread overview]
Message-ID: <20261009030111.57784-5-lei.chen@smartx.com> (raw)
In-Reply-To: <20261009030111.57784-1-lei.chen@smartx.com>

Tag set debugfs directories use numeric IDs that do not identify their
attached disks. Starting from a disk's debugfs directory therefore gives
no direct way to find its tag set configuration and CPU mappings.

Add a tagset symlink in each blk-mq request queue's debugfs directory,
pointing to ../../tagset/<id>. Queues sharing a tag set link to the same
directory. Create the link only when both debugfs directories exist.

Signed-off-by: Lei Chen <lei.chen@smartx.com>
---
 block/blk-mq-debugfs.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index 298387607049..78a91a1095bb 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -644,11 +644,19 @@ static void debugfs_create_files(struct request_queue *q, struct dentry *parent,
 
 void blk_mq_debugfs_register(struct request_queue *q)
 {
+	struct blk_mq_tag_set *set = q->tag_set;
 	struct blk_mq_hw_ctx *hctx;
 	unsigned long i;
+	char target[32];
 
 	debugfs_create_files(q, q->debugfs_dir, q, blk_mq_debugfs_queue_attrs);
 
+	if (!IS_ERR_OR_NULL(q->debugfs_dir) &&
+	    !IS_ERR_OR_NULL(set->debugfs_dir) && set->debugfs_id >= 0) {
+		snprintf(target, sizeof(target), "../../tagset/%d", set->debugfs_id);
+		debugfs_create_symlink("tagset", q->debugfs_dir, target);
+	}
+
 	queue_for_each_hw_ctx(q, hctx, i) {
 		if (!hctx->debugfs_dir)
 			blk_mq_debugfs_register_hctx(q, hctx);
-- 
2.43.0


  parent reply	other threads:[~2026-10-09  3:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09  3:01 [PATCH v1 0/4] Expose blk-mq tag sets through debugfs Lei Chen
2026-10-09  3:01 ` [PATCH v1 1/4] blk-mq: remove stale comment about non-present CPU mapping Lei Chen
2026-10-09  3:01 ` [PATCH v1 2/4] blk-mq: manage driver tags at the tag set level Lei Chen
2026-10-09  3:01 ` [PATCH v1 3/4] block: expose blk-mq tag sets through debugfs Lei Chen
2026-10-09  3:01 ` Lei Chen [this message]
2026-11-03  9:04 ` [PATCH v1 0/4] Expose " Lei Chen
2026-11-20  2:55 ` [PATCH v2 0/5] " Lei Chen
2026-11-20  2:56   ` [PATCH v2 1/5] block: expose " Lei Chen
2026-11-20  2:56   ` [PATCH v2 2/5] block: link request queue debugfs directories to tag sets Lei Chen
2026-11-20  2:56   ` [PATCH v2 3/5] block: add helpers to link tag set debugfs to controllers Lei Chen
2026-11-20  2:56   ` [PATCH v2 4/5] scsi: megaraid_sas: Link tag set debugfs to the controller Lei Chen
2026-11-20  2:56   ` [PATCH v2 5/5] scsi: mpt3sas: " Lei Chen
2026-11-20  2:58 ` [RESEND PATCH v1 0/4] Expose blk-mq tag sets through debugfs Lei Chen
2026-11-20  2:58   ` [RESEND PATCH v1 1/4] blk-mq: remove stale comment about non-present CPU mapping Lei Chen
2026-11-20  2:58   ` [RESEND PATCH v1 2/4] blk-mq: manage driver tags at the tag set level Lei Chen
2026-11-20  2:58   ` [RESEND PATCH v1 3/4] block: expose blk-mq tag sets through debugfs Lei Chen
2026-11-20  2:58   ` [RESEND PATCH v1 4/4] block: link request queue debugfs directories to tag sets Lei Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261009030111.57784-5-lei.chen@smartx.com \
    --to=lei.chen@smartx.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.