*/
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);
}
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;
/*
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;
}
* 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;
}
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);
}
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,
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;
unsigned long last_issue; /* last non-throttled issue */
unsigned long last_comp; /* last non-throttled comp */
unsigned long min_lat_nsec;
- struct backing_dev_info *bdi;
+ struct request_queue *queue;
struct rq_wait rq_wait[WBT_NUM_RWQ];
struct wb_stat_ops *stat_ops;
return ret;
}
-struct backing_dev_info;
-
#ifdef CONFIG_BLK_WBT
void __wbt_done(struct rq_wb *, enum wbt_flags);