summaryrefslogtreecommitdiffstats
path: root/block/blk-stat.c
diff options
context:
space:
mode:
authorOmar Sandoval <osandov@fb.com>2018-05-09 02:08:53 -0700
committerJens Axboe <axboe@kernel.dk>2018-05-09 08:33:09 -0600
commit522a777566f5669606a1227bf13f3fb40963780b (patch)
tree7d37c9d591e5a9abb4fd1209f1c503ae1a0e8475 /block/blk-stat.c
parent4bc6339a583cec650b05d6fdcc83f03f941c1a3b (diff)
downloadlinux-522a777566f5669606a1227bf13f3fb40963780b.tar.gz
linux-522a777566f5669606a1227bf13f3fb40963780b.tar.bz2
linux-522a777566f5669606a1227bf13f3fb40963780b.zip
block: consolidate struct request timestamp fields
Currently, struct request has four timestamp fields: - A start time, set at get_request time, in jiffies, used for iostats - An I/O start time, set at start_request time, in ktime nanoseconds, used for blk-stats (i.e., wbt, kyber, hybrid polling) - Another start time and another I/O start time, used for cfq and bfq These can all be consolidated into one start time and one I/O start time, both in ktime nanoseconds, shaving off up to 16 bytes from struct request depending on the kernel config. Signed-off-by: Omar Sandoval <osandov@fb.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-stat.c')
-rw-r--r--block/blk-stat.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/block/blk-stat.c b/block/blk-stat.c
index 725a881723b0..175c143ac5b9 100644
--- a/block/blk-stat.c
+++ b/block/blk-stat.c
@@ -47,15 +47,14 @@ static void __blk_stat_add(struct blk_rq_stat *stat, u64 value)
stat->nr_samples++;
}
-void blk_stat_add(struct request *rq)
+void blk_stat_add(struct request *rq, u64 now)
{
struct request_queue *q = rq->q;
struct blk_stat_callback *cb;
struct blk_rq_stat *stat;
int bucket;
- u64 now, value;
+ u64 value;
- now = ktime_get_ns();
value = (now >= rq->io_start_time_ns) ? now - rq->io_start_time_ns : 0;
blk_throtl_stat_add(rq, value);