diff options
author | Jens Axboe <axboe@fb.com> | 2016-11-07 21:32:37 -0700 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-11-10 13:53:26 -0700 |
commit | cf43e6be865a582ba66ee4747ae27a0513f6bba1 (patch) | |
tree | 53b71dd2f456e4880428683631fd09c9dc0747a5 /block/blk-mq.h | |
parent | ebc4ff661fbe76781c6b16dfb7b754a5d5073f8e (diff) | |
download | linux-cf43e6be865a582ba66ee4747ae27a0513f6bba1.tar.gz linux-cf43e6be865a582ba66ee4747ae27a0513f6bba1.tar.bz2 linux-cf43e6be865a582ba66ee4747ae27a0513f6bba1.zip |
block: add scalable completion tracking of requests
For legacy block, we simply track them in the request queue. For
blk-mq, we track them on a per-sw queue basis, which we can then
sum up through the hardware queues and finally to a per device
state.
The stats are tracked in, roughly, 0.1s interval windows.
Add sysfs files to display the stats.
The feature is off by default, to avoid any extra overhead. In-kernel
users of it can turn it on by setting QUEUE_FLAG_STATS in the queue
flags. We currently don't turn it on if someone just reads any of
the stats files, that is something we could add as well.
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-mq.h')
-rw-r--r-- | block/blk-mq.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/block/blk-mq.h b/block/blk-mq.h index ac772dac7ce8..b444370ae05b 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h @@ -1,6 +1,8 @@ #ifndef INT_BLK_MQ_H #define INT_BLK_MQ_H +#include "blk-stat.h" + struct blk_mq_tag_set; struct blk_mq_ctx { @@ -18,6 +20,7 @@ struct blk_mq_ctx { /* incremented at completion time */ unsigned long ____cacheline_aligned_in_smp rq_completed[2]; + struct blk_rq_stat stat[2]; struct request_queue *queue; struct kobject kobj; |