summaryrefslogtreecommitdiffstats
path: root/block/blk-wbt.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2016-11-10 21:52:53 -0700
committerJens Axboe <axboe@fb.com>2016-11-11 16:18:18 -0700
commitd8a0cbfd73cb7281120d1b49f90afeef26ad48a2 (patch)
treed856e1099a712e7333cbcf3585d6881cd23bf3aa /block/blk-wbt.c
parentbbd7bb7017d5c2b1e75f3818b4ce88fa58bb0eab (diff)
downloadlinux-d8a0cbfd73cb7281120d1b49f90afeef26ad48a2.tar.bz2
blk-wbt: store queue instead of bdi
The bdi was a leftover from when the code was block layer agnostic. Now that we just support a block layer user, store the queue directly. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-wbt.c')
-rw-r--r--block/blk-wbt.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/block/blk-wbt.c b/block/blk-wbt.c
index 889c17ff8503..4ab9cebc8003 100644
--- a/block/blk-wbt.c
+++ b/block/blk-wbt.c
@@ -96,7 +96,7 @@ static void wb_timestamp(struct rq_wb *rwb, unsigned long *var)
*/
static bool wb_recent_wait(struct rq_wb *rwb)
{
- struct bdi_writeback *wb = &rwb->bdi->wb;
+ struct bdi_writeback *wb = &rwb->queue->backing_dev_info.wb;
return time_before(jiffies, wb->dirty_sleep + HZ);
}
@@ -279,6 +279,7 @@ enum {
static int __latency_exceeded(struct rq_wb *rwb, struct blk_rq_stat *stat)
{
+ struct backing_dev_info *bdi = &rwb->queue->backing_dev_info;
u64 thislat;
/*
@@ -293,7 +294,7 @@ static int __latency_exceeded(struct rq_wb *rwb, struct blk_rq_stat *stat)
thislat = rwb_sync_issue_lat(rwb);
if (thislat > rwb->cur_win_nsec ||
(thislat > rwb->min_lat_nsec && !stat[0].nr_samples)) {
- trace_wbt_lat(rwb->bdi, thislat);
+ trace_wbt_lat(bdi, thislat);
return LAT_EXCEEDED;
}
@@ -317,13 +318,13 @@ static int __latency_exceeded(struct rq_wb *rwb, struct blk_rq_stat *stat)
* If the 'min' latency exceeds our target, step down.
*/
if (stat[0].min > rwb->min_lat_nsec) {
- trace_wbt_lat(rwb->bdi, stat[0].min);
- trace_wbt_stat(rwb->bdi, stat);
+ trace_wbt_lat(bdi, stat[0].min);
+ trace_wbt_stat(bdi, stat);
return LAT_EXCEEDED;
}
if (rwb->scale_step)
- trace_wbt_stat(rwb->bdi, stat);
+ trace_wbt_stat(bdi, stat);
return LAT_OK;
}
@@ -338,7 +339,9 @@ static int latency_exceeded(struct rq_wb *rwb)
static void rwb_trace_step(struct rq_wb *rwb, const char *msg)
{
- trace_wbt_step(rwb->bdi, msg, rwb->scale_step, rwb->cur_win_nsec,
+ struct backing_dev_info *bdi = &rwb->queue->backing_dev_info;
+
+ trace_wbt_step(bdi, msg, rwb->scale_step, rwb->cur_win_nsec,
rwb->wb_background, rwb->wb_normal, rwb->wb_max);
}
@@ -420,7 +423,8 @@ static void wb_timer_fn(unsigned long data)
status = latency_exceeded(rwb);
- trace_wbt_timer(rwb->bdi, status, rwb->scale_step, inflight);
+ trace_wbt_timer(&rwb->queue->backing_dev_info, status, rwb->scale_step,
+ inflight);
/*
* If we exceeded the latency target, step down. If we did not,
@@ -700,7 +704,7 @@ int wbt_init(struct request_queue *q, struct wb_stat_ops *ops)
rwb->wc = 1;
rwb->queue_depth = RWB_DEF_DEPTH;
rwb->last_comp = rwb->last_issue = jiffies;
- rwb->bdi = &q->backing_dev_info;
+ rwb->queue = q;
rwb->win_nsec = RWB_WINDOW_NSEC;
rwb->stat_ops = ops;
rwb->ops_data = q;