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-wbt.c | |
parent | 5238dcf4136fd7287be8e7d38752645bfa5782ec (diff) |
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-wbt.c')
-rw-r--r-- | block/blk-wbt.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/block/blk-wbt.c b/block/blk-wbt.c index 592e914c9890..4f89b28fa652 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -31,22 +31,22 @@ static inline void wbt_clear_state(struct request *rq) { - rq->issue_stat.stat &= ~BLK_STAT_RES_MASK; + rq->wbt_flags = 0; } static inline enum wbt_flags wbt_flags(struct request *rq) { - return (rq->issue_stat.stat & BLK_STAT_RES_MASK) >> BLK_STAT_RES_SHIFT; + return rq->wbt_flags; } static inline bool wbt_is_tracked(struct request *rq) { - return (rq->issue_stat.stat >> BLK_STAT_RES_SHIFT) & WBT_TRACKED; + return rq->wbt_flags & WBT_TRACKED; } static inline bool wbt_is_read(struct request *rq) { - return (rq->issue_stat.stat >> BLK_STAT_RES_SHIFT) & WBT_READ; + return rq->wbt_flags & WBT_READ; } enum { @@ -657,7 +657,7 @@ void wbt_issue(struct rq_wb *rwb, struct request *rq) */ if (wbt_is_read(rq) && !rwb->sync_issue) { rwb->sync_cookie = rq; - rwb->sync_issue = blk_stat_time(&rq->issue_stat); + rwb->sync_issue = rq->io_start_time_ns; } } @@ -746,8 +746,6 @@ int wbt_init(struct request_queue *q) struct rq_wb *rwb; int i; - BUILD_BUG_ON(WBT_NR_BITS > BLK_STAT_RES_BITS); - rwb = kzalloc(sizeof(*rwb), GFP_KERNEL); if (!rwb) return -ENOMEM; |