From: axboe@kernel.dk (Jens Axboe)
Subject: [PATCH 06/14] blk-mq: add 'type' attribute to the sysfs hctx directory
Date: Thu, 25 Oct 2018 15:16:18 -0600 [thread overview]
Message-ID: <20181025211626.12692-7-axboe@kernel.dk> (raw)
In-Reply-To: <20181025211626.12692-1-axboe@kernel.dk>
It can be useful for a user to verify what type a given hardware
queue is, expose this information in sysfs.
Signed-off-by: Jens Axboe <axboe at kernel.dk>
---
block/blk-mq-sysfs.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/block/blk-mq-sysfs.c b/block/blk-mq-sysfs.c
index aafb44224c89..2d737f9e7ba7 100644
--- a/block/blk-mq-sysfs.c
+++ b/block/blk-mq-sysfs.c
@@ -161,6 +161,11 @@ static ssize_t blk_mq_hw_sysfs_cpus_show(struct blk_mq_hw_ctx *hctx, char *page)
return ret;
}
+static ssize_t blk_mq_hw_sysfs_type_show(struct blk_mq_hw_ctx *hctx, char *page)
+{
+ return sprintf(page, "%u\n", hctx->type);
+}
+
static struct attribute *default_ctx_attrs[] = {
NULL,
};
@@ -177,11 +182,16 @@ static struct blk_mq_hw_ctx_sysfs_entry blk_mq_hw_sysfs_cpus = {
.attr = {.name = "cpu_list", .mode = 0444 },
.show = blk_mq_hw_sysfs_cpus_show,
};
+static struct blk_mq_hw_ctx_sysfs_entry blk_mq_hw_sysfs_type = {
+ .attr = {.name = "type", .mode = 0444 },
+ .show = blk_mq_hw_sysfs_type_show,
+};
static struct attribute *default_hw_ctx_attrs[] = {
&blk_mq_hw_sysfs_nr_tags.attr,
&blk_mq_hw_sysfs_nr_reserved_tags.attr,
&blk_mq_hw_sysfs_cpus.attr,
+ &blk_mq_hw_sysfs_type.attr,
NULL,
};
--
2.17.1
next prev parent reply other threads:[~2018-10-25 21:16 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-25 21:16 [PATCHSET 0/14] Add support for multiple queue maps Jens Axboe
2018-10-25 21:16 ` [PATCH 01/14] blk-mq: kill q->mq_map Jens Axboe
2018-10-27 14:19 ` jianchao.wang
2018-10-27 16:48 ` Jens Axboe
2018-10-27 16:52 ` Jens Axboe
2018-10-29 2:02 ` jianchao.wang
2018-10-29 2:40 ` jianchao.wang
2018-10-29 3:00 ` Jens Axboe
2018-10-29 9:03 ` jianchao.wang
2018-10-28 16:10 ` Christoph Hellwig
2018-10-29 7:27 ` Hannes Reinecke
2018-10-25 21:16 ` [PATCH 02/14] blk-mq: abstract out queue map Jens Axboe
2018-10-29 7:30 ` Hannes Reinecke
2018-10-25 21:16 ` [PATCH 03/14] blk-mq: provide dummy blk_mq_map_queue_type() helper Jens Axboe
2018-10-29 7:30 ` Hannes Reinecke
2018-10-25 21:16 ` [PATCH 04/14] blk-mq: pass in request/bio flags to queue mapping Jens Axboe
2018-10-29 7:35 ` Hannes Reinecke
2018-10-25 21:16 ` [PATCH 05/14] blk-mq: allow software queue to map to multiple hardware queues Jens Axboe
2018-10-29 7:37 ` Hannes Reinecke
2018-10-25 21:16 ` Jens Axboe [this message]
2018-10-29 7:38 ` [PATCH 06/14] blk-mq: add 'type' attribute to the sysfs hctx directory Hannes Reinecke
2018-10-25 21:16 ` [PATCH 07/14] blk-mq: support multiple hctx maps Jens Axboe
2018-10-29 7:39 ` Hannes Reinecke
2018-10-25 21:16 ` [PATCH 08/14] blk-mq: separate number of hardware queues from nr_cpu_ids Jens Axboe
2018-10-29 7:40 ` Hannes Reinecke
2018-10-25 21:16 ` [PATCH 09/14] blk-mq: ensure that plug lists don't straddle hardware queues Jens Axboe
2018-10-29 7:40 ` Hannes Reinecke
2018-10-25 21:16 ` [PATCH 10/14] blk-mq: initial support for multiple queue maps Jens Axboe
2018-10-29 7:41 ` Hannes Reinecke
2018-10-25 21:16 ` [PATCH 11/14] irq: add support for allocating (and affinitizing) sets of IRQs Jens Axboe
2018-10-25 21:52 ` Keith Busch
2018-10-25 23:07 ` Jens Axboe
2018-10-29 7:43 ` Hannes Reinecke
2018-10-25 21:16 ` [PATCH 12/14] nvme: utilize two queue maps, one for reads and one for writes Jens Axboe
2018-10-29 7:46 ` Hannes Reinecke
2018-10-25 21:16 ` [PATCH 13/14] block: add REQ_HIPRI and inherit it from IOCB_HIPRI Jens Axboe
2018-10-29 7:47 ` Hannes Reinecke
2018-10-25 21:16 ` [PATCH 14/14] nvme: add separate poll queue map Jens Axboe
2018-10-29 7:48 ` Hannes Reinecke
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=20181025211626.12692-7-axboe@kernel.dk \
--to=axboe@kernel.dk \
/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