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>
This commit is contained in:
Omar Sandoval
2018-05-09 02:08:50 -07:00
committed by Jens Axboe
parent 5238dcf413
commit 544ccc8dc9
10 changed files with 41 additions and 77 deletions
+5 -7
View File
@@ -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;