summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorStephen Bates <sbates@raithlin.com>2017-04-20 16:59:11 -0600
committerJens Axboe <axboe@fb.com>2017-04-20 17:10:48 -0600
commit0206319fdfee7c36b97aa6c0561bab206132f813 (patch)
treeb7338a78b1162079ed46003cadb5206d7672e235 /block
parentb00c53e8f411a0b2be036c41852c6858541afbf7 (diff)
downloadlinux-0206319fdfee7c36b97aa6c0561bab206132f813.tar.bz2
blk-mq: Fix poll_stat for new size-based bucketing.
Fixes an issue where the size of the poll_stat array in request_queue does not match the size expected by the new size based bucketing for IO completion polling. Fixes: 720b8ccc4500 ("blk-mq: Add a polling specific stats function") Signed-off-by: Stephen Bates <sbates@raithlin.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq-debugfs.c15
-rw-r--r--block/blk-mq.c2
2 files changed, 9 insertions, 8 deletions
diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index df9b688b877c..3057641d5d15 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -159,14 +159,17 @@ static void print_stat(struct seq_file *m, struct blk_rq_stat *stat)
static int queue_poll_stat_show(struct seq_file *m, void *v)
{
struct request_queue *q = m->private;
+ int bucket;
- seq_puts(m, "read: ");
- print_stat(m, &q->poll_stat[READ]);
- seq_puts(m, "\n");
+ 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_puts(m, "write: ");
- print_stat(m, &q->poll_stat[WRITE]);
- 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;
}
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 47b810638729..b6dc9ba38e35 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -42,8 +42,6 @@ static LIST_HEAD(all_q_list);
static void blk_mq_poll_stats_start(struct request_queue *q);
static void blk_mq_poll_stats_fn(struct blk_stat_callback *cb);
-/* Must be consisitent with function below */
-#define BLK_MQ_POLL_STATS_BKTS 16
static int blk_mq_poll_stats_bkt(const struct request *rq)
{
int ddir, bytes, bucket;