* [PATCH 0/2] Make the zone locking information available in debugfs
@ 2018-02-28 0:32 Bart Van Assche
2018-02-28 0:32 ` [PATCH 1/2] blk-mq-debugfs: Reorder queue show and store methods Bart Van Assche
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Bart Van Assche @ 2018-02-28 0:32 UTC (permalink / raw)
To: Jens Axboe
Cc: linux-block, Christoph Hellwig, Damien Le Moal, Bart Van Assche
Hello Jens,
While analyzing the mq-deadline behavior for ZBC drives together with Damien
we noticed the following:
- That the request queue attribute methods are not contiguous in
blk-mq-debugfs.c.
- That the information about which zones are locked is not yet available in
debugfs.
Hence this patch series. Please consider this patch series for kernel v4.17.
Thanks,
Bart.
Bart Van Assche (2):
blk-mq-debugfs: Reorder queue show and store methods
blk-mq-debugfs: Show zone locking information
block/blk-mq-debugfs.c | 134 +++++++++++++++++++++++++++----------------------
1 file changed, 75 insertions(+), 59 deletions(-)
--
2.16.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] blk-mq-debugfs: Reorder queue show and store methods
2018-02-28 0:32 [PATCH 0/2] Make the zone locking information available in debugfs Bart Van Assche
@ 2018-02-28 0:32 ` Bart Van Assche
2018-02-28 0:32 ` [PATCH 2/2] blk-mq-debugfs: Show zone locking information Bart Van Assche
2018-02-28 15:45 ` [PATCH 0/2] Make the zone locking information available in debugfs Jens Axboe
2 siblings, 0 replies; 5+ messages in thread
From: Bart Van Assche @ 2018-02-28 0:32 UTC (permalink / raw)
To: Jens Axboe
Cc: linux-block, Christoph Hellwig, Damien Le Moal, Bart Van Assche,
Omar Sandoval, Ming Lei, Hannes Reinecke, Johannes Thumshirn
Make sure that the queue show and store methods are contiguous and
also that these appear in alphabetical order.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Damien Le Moal <damien.lemoal@wdc.com>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
---
block/blk-mq-debugfs.c | 130 ++++++++++++++++++++++++-------------------------
1 file changed, 65 insertions(+), 65 deletions(-)
diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index a5a6fc5304e2..eaf282e239b0 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -24,6 +24,64 @@
#include "blk-mq-debugfs.h"
#include "blk-mq-tag.h"
+static void print_stat(struct seq_file *m, struct blk_rq_stat *stat)
+{
+ if (stat->nr_samples) {
+ seq_printf(m, "samples=%d, mean=%lld, min=%llu, max=%llu",
+ stat->nr_samples, stat->mean, stat->min, stat->max);
+ } else {
+ seq_puts(m, "samples=0");
+ }
+}
+
+static int queue_poll_stat_show(void *data, struct seq_file *m)
+{
+ struct request_queue *q = data;
+ int bucket;
+
+ for (bucket = 0; bucket < BLK_MQ_POLL_STATS_BKTS/2; bucket++) {
+ seq_printf(m, "read (%d Bytes): ", 1 << (9+bucket));
+ print_stat(m, &q->poll_stat[2*bucket]);
+ seq_puts(m, "\n");
+
+ seq_printf(m, "write (%d Bytes): ", 1 << (9+bucket));
+ print_stat(m, &q->poll_stat[2*bucket+1]);
+ seq_puts(m, "\n");
+ }
+ return 0;
+}
+
+static void *queue_requeue_list_start(struct seq_file *m, loff_t *pos)
+ __acquires(&q->requeue_lock)
+{
+ struct request_queue *q = m->private;
+
+ spin_lock_irq(&q->requeue_lock);
+ return seq_list_start(&q->requeue_list, *pos);
+}
+
+static void *queue_requeue_list_next(struct seq_file *m, void *v, loff_t *pos)
+{
+ struct request_queue *q = m->private;
+
+ return seq_list_next(v, &q->requeue_list, pos);
+}
+
+static void queue_requeue_list_stop(struct seq_file *m, void *v)
+ __releases(&q->requeue_lock)
+{
+ struct request_queue *q = m->private;
+
+ spin_unlock_irq(&q->requeue_lock);
+}
+
+static const struct seq_operations queue_requeue_list_seq_ops = {
+ .start = queue_requeue_list_start,
+ .next = queue_requeue_list_next,
+ .stop = queue_requeue_list_stop,
+ .show = blk_mq_debugfs_rq_show,
+};
+
static int blk_flags_show(struct seq_file *m, const unsigned long flags,
const char *const *flag_name, int flag_name_count)
{
@@ -125,16 +183,6 @@ static ssize_t queue_state_write(void *data, const char __user *buf,
return count;
}
-static void print_stat(struct seq_file *m, struct blk_rq_stat *stat)
-{
- if (stat->nr_samples) {
- seq_printf(m, "samples=%d, mean=%lld, min=%llu, max=%llu",
- stat->nr_samples, stat->mean, stat->min, stat->max);
- } else {
- seq_puts(m, "samples=0");
- }
-}
-
static int queue_write_hint_show(void *data, struct seq_file *m)
{
struct request_queue *q = data;
@@ -158,22 +206,13 @@ static ssize_t queue_write_hint_store(void *data, const char __user *buf,
return count;
}
-static int queue_poll_stat_show(void *data, struct seq_file *m)
-{
- struct request_queue *q = data;
- int bucket;
-
- for (bucket = 0; bucket < BLK_MQ_POLL_STATS_BKTS/2; bucket++) {
- seq_printf(m, "read (%d Bytes): ", 1 << (9+bucket));
- print_stat(m, &q->poll_stat[2*bucket]);
- seq_puts(m, "\n");
-
- seq_printf(m, "write (%d Bytes): ", 1 << (9+bucket));
- print_stat(m, &q->poll_stat[2*bucket+1]);
- seq_puts(m, "\n");
- }
- 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 },
+ { "state", 0600, queue_state_show, queue_state_write },
+ { "write_hints", 0600, queue_write_hint_show, queue_write_hint_store },
+ { },
+};
#define HCTX_STATE_NAME(name) [BLK_MQ_S_##name] = #name
static const char *const hctx_state_name[] = {
@@ -335,37 +374,6 @@ int blk_mq_debugfs_rq_show(struct seq_file *m, void *v)
}
EXPORT_SYMBOL_GPL(blk_mq_debugfs_rq_show);
-static void *queue_requeue_list_start(struct seq_file *m, loff_t *pos)
- __acquires(&q->requeue_lock)
-{
- struct request_queue *q = m->private;
-
- spin_lock_irq(&q->requeue_lock);
- return seq_list_start(&q->requeue_list, *pos);
-}
-
-static void *queue_requeue_list_next(struct seq_file *m, void *v, loff_t *pos)
-{
- struct request_queue *q = m->private;
-
- return seq_list_next(v, &q->requeue_list, pos);
-}
-
-static void queue_requeue_list_stop(struct seq_file *m, void *v)
- __releases(&q->requeue_lock)
-{
- struct request_queue *q = m->private;
-
- spin_unlock_irq(&q->requeue_lock);
-}
-
-static const struct seq_operations queue_requeue_list_seq_ops = {
- .start = queue_requeue_list_start,
- .next = queue_requeue_list_next,
- .stop = queue_requeue_list_stop,
- .show = blk_mq_debugfs_rq_show,
-};
-
static void *hctx_dispatch_start(struct seq_file *m, loff_t *pos)
__acquires(&hctx->lock)
{
@@ -761,14 +769,6 @@ static const struct file_operations blk_mq_debugfs_fops = {
.release = blk_mq_debugfs_release,
};
-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},
- {"state", 0600, queue_state_show, queue_state_write},
- {"write_hints", 0600, queue_write_hint_show, queue_write_hint_store},
- {},
-};
-
static const struct blk_mq_debugfs_attr blk_mq_debugfs_hctx_attrs[] = {
{"state", 0400, hctx_state_show},
{"flags", 0400, hctx_flags_show},
--
2.16.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] blk-mq-debugfs: Show zone locking information
2018-02-28 0:32 [PATCH 0/2] Make the zone locking information available in debugfs Bart Van Assche
2018-02-28 0:32 ` [PATCH 1/2] blk-mq-debugfs: Reorder queue show and store methods Bart Van Assche
@ 2018-02-28 0:32 ` Bart Van Assche
2018-02-28 1:52 ` Damien Le Moal
2018-02-28 15:45 ` [PATCH 0/2] Make the zone locking information available in debugfs Jens Axboe
2 siblings, 1 reply; 5+ messages in thread
From: Bart Van Assche @ 2018-02-28 0:32 UTC (permalink / raw)
To: Jens Axboe
Cc: linux-block, Christoph Hellwig, Damien Le Moal, Bart Van Assche,
Omar Sandoval, Ming Lei, Hannes Reinecke, Johannes Thumshirn
When debugging the ZBC code in the mq-deadline scheduler it is very
important to know which zones are locked and which zones are not
locked. Hence this patch that exports the zone locking information
through debugfs.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Damien Le Moal <damien.lemoal@wdc.com>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
---
block/blk-mq-debugfs.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index eaf282e239b0..1be2116e09b5 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -206,11 +206,27 @@ static ssize_t queue_write_hint_store(void *data, const char __user *buf,
return count;
}
+static int queue_zone_wlock_show(void *data, struct seq_file *m)
+{
+ struct request_queue *q = data;
+ unsigned int i;
+
+ if (!q->seq_zones_wlock)
+ return 0;
+
+ for (i = 0; i < blk_queue_nr_zones(q); i++)
+ if (test_bit(i, q->seq_zones_wlock))
+ seq_printf(m, "%u\n", i);
+
+ 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 },
{ "state", 0600, queue_state_show, queue_state_write },
{ "write_hints", 0600, queue_write_hint_show, queue_write_hint_store },
+ { "zone_wlock", 0400, queue_zone_wlock_show, NULL },
{ },
};
--
2.16.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] blk-mq-debugfs: Show zone locking information
2018-02-28 0:32 ` [PATCH 2/2] blk-mq-debugfs: Show zone locking information Bart Van Assche
@ 2018-02-28 1:52 ` Damien Le Moal
0 siblings, 0 replies; 5+ messages in thread
From: Damien Le Moal @ 2018-02-28 1:52 UTC (permalink / raw)
To: Bart Van Ass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taWVuLmxlbW9hbEB3ZGMuY29tPg0KDQoN
Ci0tIA0KRGFtaWVuIExlIE1vYWwNCldlc3Rlcm4gRGlnaXRhbCBSZXNlYXJjaA==
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] Make the zone locking information available in debugfs
2018-02-28 0:32 [PATCH 0/2] Make the zone locking information available in debugfs Bart Van Assche
2018-02-28 0:32 ` [PATCH 1/2] blk-mq-debugfs: Reorder queue show and store methods Bart Van Assche
2018-02-28 0:32 ` [PATCH 2/2] blk-mq-debugfs: Show zone locking information Bart Van Assche
@ 2018-02-28 15:45 ` Jens Axboe
2 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2018-02-28 15:45 UTC (permalink / raw)
To: Bart Van Assche; +Cc: linux-block, Christoph Hellwig, Damien Le Moal
On 2/27/18 5:32 PM, Bart Van Assche wrote:
> Hello Jens,
>
> While analyzing the mq-deadline behavior for ZBC drives together with Damien
> we noticed the following:
> - That the request queue attribute methods are not contiguous in
> blk-mq-debugfs.c.
> - That the information about which zones are locked is not yet available in
> debugfs.
>
> Hence this patch series. Please consider this patch series for kernel v4.17.
Looks sane to me, applied.
--
Jens Axboe
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-02-28 15:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-28 0:32 [PATCH 0/2] Make the zone locking information available in debugfs Bart Van Assche
2018-02-28 0:32 ` [PATCH 1/2] blk-mq-debugfs: Reorder queue show and store methods Bart Van Assche
2018-02-28 0:32 ` [PATCH 2/2] blk-mq-debugfs: Show zone locking information Bart Van Assche
2018-02-28 1:52 ` Damien Le Moal
2018-02-28 15:45 ` [PATCH 0/2] Make the zone locking information available in debugfs Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox