mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "yukuai (C)" <yukuai3@huawei.com>
To: <axboe@kernel.dk>
Cc: <linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<yi.zhang@huawei.com>
Subject: Re: [PATCH] blk-mq: add debugfs to print information for blk_mq_tag_set
Date: Fri, 8 Apr 2022 14:54:24 +0800	[thread overview]
Message-ID: <a7d35fc4-2ec5-7b64-4990-8a3a5bffa358@huawei.com> (raw)
In-Reply-To: <20220401035319.274260-1-yukuai3@huawei.com>

friendly ping ...

在 2022/04/01 11:53, Yu Kuai 写道:
> This should be helpful to solve some problems.
> 
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
>   block/blk-mq-debugfs.c | 54 ++++++++++++++++++++++++++++++++++++++----
>   1 file changed, 50 insertions(+), 4 deletions(-)
> 
> diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
> index aa0349e9f083..3c6260df7a95 100644
> --- a/block/blk-mq-debugfs.c
> +++ b/block/blk-mq-debugfs.c
> @@ -183,12 +183,52 @@ static ssize_t queue_state_write(void *data, const char __user *buf,
>   	return count;
>   }
>   
> +static void __flags_show(unsigned long flags, struct seq_file *m);
> +
> +static int queue_tag_set_show(void *data, struct seq_file *m)
> +{
> +	struct request_queue *q = data;
> +	struct blk_mq_tag_set *set = q->tag_set;
> +	int i, j;
> +
> +	seq_puts(m, "map:\n");
> +	for (i = 0; i < set->nr_maps; ++i) {
> +		struct blk_mq_queue_map *map = &set->map[i];
> +
> +		if (!map) {
> +			seq_puts(m, "    NULL\n");
> +			continue;
> +		}
> +
> +		seq_printf(m, "    nr_queues %u offset %u map:", map->nr_queues,
> +			   map->queue_offset);
> +		if (!map->mq_map) {
> +			seq_puts(m, " NULL\n");
> +			continue;
> +		}
> +		for (j = 0; j < nr_cpu_ids; ++j)
> +			seq_printf(m, " %u", map->mq_map[j]);
> +		seq_puts(m, "\n");
> +	}
> +
> +	seq_printf(m, "nr_hw_queues: %u\n", set->nr_hw_queues);
> +	seq_printf(m, "queue_depth: %u\n", set->queue_depth);
> +	seq_printf(m, "reserved_tags: %u\n", set->reserved_tags);
> +	seq_printf(m, "cmd_size: %u\n", set->cmd_size);
> +	seq_printf(m, "numa_node: %d\n", set->numa_node);
> +	seq_printf(m, "timeout: %u\n", set->timeout);
> +	__flags_show(set->flags, m);
> +
> +	return 0;
> +}
> +
>   static const struct blk_mq_debugfs_attr blk_mq_debugfs_queue_attrs[] = {
>   	{ "poll_stat", 0400, queue_poll_stat_show },
>   	{ "requeue_list", 0400, .seq_ops = &queue_requeue_list_seq_ops },
>   	{ "pm_only", 0600, queue_pm_only_show, NULL },
>   	{ "state", 0600, queue_state_show, queue_state_write },
>   	{ "zone_wlock", 0400, queue_zone_wlock_show, NULL },
> +	{ "tag_set", 0400, queue_tag_set_show, NULL },
>   	{ },
>   };
>   
> @@ -229,10 +269,9 @@ static const char *const hctx_flag_name[] = {
>   };
>   #undef HCTX_FLAG_NAME
>   
> -static int hctx_flags_show(void *data, struct seq_file *m)
> +static void __flags_show(unsigned long flags, struct seq_file *m)
>   {
> -	struct blk_mq_hw_ctx *hctx = data;
> -	const int alloc_policy = BLK_MQ_FLAG_TO_ALLOC_POLICY(hctx->flags);
> +	const int alloc_policy = BLK_MQ_FLAG_TO_ALLOC_POLICY(flags);
>   
>   	seq_puts(m, "alloc_policy=");
>   	if (alloc_policy < ARRAY_SIZE(alloc_policy_name) &&
> @@ -242,9 +281,16 @@ static int hctx_flags_show(void *data, struct seq_file *m)
>   		seq_printf(m, "%d", alloc_policy);
>   	seq_puts(m, " ");
>   	blk_flags_show(m,
> -		       hctx->flags ^ BLK_ALLOC_POLICY_TO_MQ_FLAG(alloc_policy),
> +		       flags ^ BLK_ALLOC_POLICY_TO_MQ_FLAG(alloc_policy),
>   		       hctx_flag_name, ARRAY_SIZE(hctx_flag_name));
>   	seq_puts(m, "\n");
> +}
> +
> +static int hctx_flags_show(void *data, struct seq_file *m)
> +{
> +	struct blk_mq_hw_ctx *hctx = data;
> +
> +	__flags_show(hctx->flags, m);
>   	return 0;
>   }
>   
> 

      reply	other threads:[~2022-04-08  6:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-01  3:53 Yu Kuai
2022-04-08  6:54 ` yukuai (C) [this message]

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=a7d35fc4-2ec5-7b64-4990-8a3a5bffa358@huawei.com \
    --to=yukuai3@huawei.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yi.zhang@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®