diff options
author | Omar Sandoval <osandov@fb.com> | 2018-05-09 02:08:50 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-05-09 08:33:05 -0600 |
commit | 544ccc8dc904db55d4576c27a1eb66a888ffacea (patch) | |
tree | 5fa92e3cf1a5d33eddc61dfd65d088dd5cdb6f84 /block/blk-stat.h | |
parent | 5238dcf4136fd7287be8e7d38752645bfa5782ec (diff) | |
download | blackbird-op-linux-544ccc8dc904db55d4576c27a1eb66a888ffacea.tar.gz blackbird-op-linux-544ccc8dc904db55d4576c27a1eb66a888ffacea.zip |
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 <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-stat.h')
-rw-r--r-- | block/blk-stat.h | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/block/blk-stat.h b/block/blk-stat.h index c22049a8125e..17c812db0aca 100644 --- a/block/blk-stat.h +++ b/block/blk-stat.h @@ -8,21 +8,6 @@ #include <linux/rcupdate.h> #include <linux/timer.h> -/* - * from upper: - * 4 bits: reserved for other usage - * 12 bits: size - * 48 bits: time - */ -#define BLK_STAT_RES_BITS 4 -#define BLK_STAT_SIZE_BITS 12 -#define BLK_STAT_RES_SHIFT (64 - BLK_STAT_RES_BITS) -#define BLK_STAT_SIZE_SHIFT (BLK_STAT_RES_SHIFT - BLK_STAT_SIZE_BITS) -#define BLK_STAT_TIME_MASK ((1ULL << BLK_STAT_SIZE_SHIFT) - 1) -#define BLK_STAT_SIZE_MASK \ - (((1ULL << BLK_STAT_SIZE_BITS) - 1) << BLK_STAT_SIZE_SHIFT) -#define BLK_STAT_RES_MASK (~((1ULL << BLK_STAT_RES_SHIFT) - 1)) - /** * struct blk_stat_callback - Block statistics callback. * @@ -82,34 +67,6 @@ void blk_free_queue_stats(struct blk_queue_stats *); void blk_stat_add(struct request *); -static inline u64 __blk_stat_time(u64 time) -{ - return time & BLK_STAT_TIME_MASK; -} - -static inline u64 blk_stat_time(struct blk_issue_stat *stat) -{ - return __blk_stat_time(stat->stat); -} - -static inline sector_t blk_capped_size(sector_t size) -{ - return size & ((1ULL << BLK_STAT_SIZE_BITS) - 1); -} - -static inline sector_t blk_stat_size(struct blk_issue_stat *stat) -{ - return (stat->stat & BLK_STAT_SIZE_MASK) >> BLK_STAT_SIZE_SHIFT; -} - -static inline void blk_stat_set_issue(struct blk_issue_stat *stat, - sector_t size) -{ - stat->stat = (stat->stat & BLK_STAT_RES_MASK) | - (ktime_to_ns(ktime_get()) & BLK_STAT_TIME_MASK) | - (((u64)blk_capped_size(size)) << BLK_STAT_SIZE_SHIFT); -} - /* record time/size info in request but not add a callback */ void blk_stat_enable_accounting(struct request_queue *q); |