From 544ccc8dc904db55d4576c27a1eb66a888ffacea Mon Sep 17 00:00:00 2001 From: Omar Sandoval Date: Wed, 9 May 2018 02:08:50 -0700 Subject: block: get rid of struct blk_issue_stat struct blk_issue_stat squashes three things into one u64: - The time the driver started working on a request - The original size of the request (for the io.low controller) - Flags for writeback throttling It turns out that on x86_64, we have a 4 byte hole in struct request which we can fill with the non-timestamp fields from blk_issue_stat, simplifying things quite a bit. Signed-off-by: Omar Sandoval Signed-off-by: Jens Axboe --- block/blk-stat.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'block/blk-stat.c') diff --git a/block/blk-stat.c b/block/blk-stat.c index bd365a95fcf8..725a881723b0 100644 --- a/block/blk-stat.c +++ b/block/blk-stat.c @@ -55,11 +55,8 @@ void blk_stat_add(struct request *rq) int bucket; u64 now, value; - now = __blk_stat_time(ktime_to_ns(ktime_get())); - if (now < blk_stat_time(&rq->issue_stat)) - return; - - value = now - blk_stat_time(&rq->issue_stat); + now = ktime_get_ns(); + value = (now >= rq->io_start_time_ns) ? now - rq->io_start_time_ns : 0; blk_throtl_stat_add(rq, value); -- cgit