Skip to content

Commit 25d41e4

Browse files
htejunaxboe
authored andcommitted
iocost: better trace vrate changes
vrate_adj tracepoint traces vrate changes; however, it does so only when busy_level is non-zero. busy_level turning to zero can sometimes be as interesting an event. This patch also enables vrate_adj tracepoint on other vrate related events - busy_level changes and non-zero nr_lagging. Signed-off-by: Tejun Heo <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent b89f625 commit 25d41e4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

block/blk-iocost.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,7 +1343,7 @@ static void ioc_timer_fn(struct timer_list *timer)
13431343
u32 ppm_wthr = MILLION - ioc->params.qos[QOS_WPPM];
13441344
u32 missed_ppm[2], rq_wait_pct;
13451345
u64 period_vtime;
1346-
int i;
1346+
int prev_busy_level, i;
13471347

13481348
/* how were the latencies during the period? */
13491349
ioc_lat_stat(ioc, missed_ppm, &rq_wait_pct);
@@ -1531,6 +1531,7 @@ static void ioc_timer_fn(struct timer_list *timer)
15311531
* and experiencing shortages but not surpluses, we're too stingy
15321532
* and should increase vtime rate.
15331533
*/
1534+
prev_busy_level = ioc->busy_level;
15341535
if (rq_wait_pct > RQ_WAIT_BUSY_PCT ||
15351536
missed_ppm[READ] > ppm_rthr ||
15361537
missed_ppm[WRITE] > ppm_wthr) {
@@ -1592,6 +1593,10 @@ static void ioc_timer_fn(struct timer_list *timer)
15921593
atomic64_set(&ioc->vtime_rate, vrate);
15931594
ioc->inuse_margin_vtime = DIV64_U64_ROUND_UP(
15941595
ioc->period_us * vrate * INUSE_MARGIN_PCT, 100);
1596+
} else if (ioc->busy_level != prev_busy_level || nr_lagging) {
1597+
trace_iocost_ioc_vrate_adj(ioc, atomic64_read(&ioc->vtime_rate),
1598+
&missed_ppm, rq_wait_pct, nr_lagging,
1599+
nr_shortages, nr_surpluses);
15951600
}
15961601

15971602
ioc_refresh_params(ioc, false);

0 commit comments

Comments
 (0)