diff options
author | Tejun Heo <tj@kernel.org> | 2019-09-25 19:02:07 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-09-26 03:11:58 -0400 |
commit | 25d41e4aadb0788b4fae8a8fca90f437b9ebd727 (patch) | |
tree | c6bf9df51f0bb42339a3c2c929b990b2c485fc48 /block | |
parent | b89f625e28d44552083f43752f62d8621ded0a04 (diff) |
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 <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-iocost.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 3b39deb8b9f8..32d4d6d86a99 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c | |||
@@ -1343,7 +1343,7 @@ static void ioc_timer_fn(struct timer_list *timer) | |||
1343 | u32 ppm_wthr = MILLION - ioc->params.qos[QOS_WPPM]; | 1343 | u32 ppm_wthr = MILLION - ioc->params.qos[QOS_WPPM]; |
1344 | u32 missed_ppm[2], rq_wait_pct; | 1344 | u32 missed_ppm[2], rq_wait_pct; |
1345 | u64 period_vtime; | 1345 | u64 period_vtime; |
1346 | int i; | 1346 | int prev_busy_level, i; |
1347 | 1347 | ||
1348 | /* how were the latencies during the period? */ | 1348 | /* how were the latencies during the period? */ |
1349 | ioc_lat_stat(ioc, missed_ppm, &rq_wait_pct); | 1349 | ioc_lat_stat(ioc, missed_ppm, &rq_wait_pct); |
@@ -1531,6 +1531,7 @@ skip_surplus_transfers: | |||
1531 | * and experiencing shortages but not surpluses, we're too stingy | 1531 | * and experiencing shortages but not surpluses, we're too stingy |
1532 | * and should increase vtime rate. | 1532 | * and should increase vtime rate. |
1533 | */ | 1533 | */ |
1534 | prev_busy_level = ioc->busy_level; | ||
1534 | if (rq_wait_pct > RQ_WAIT_BUSY_PCT || | 1535 | if (rq_wait_pct > RQ_WAIT_BUSY_PCT || |
1535 | missed_ppm[READ] > ppm_rthr || | 1536 | missed_ppm[READ] > ppm_rthr || |
1536 | missed_ppm[WRITE] > ppm_wthr) { | 1537 | missed_ppm[WRITE] > ppm_wthr) { |
@@ -1592,6 +1593,10 @@ skip_surplus_transfers: | |||
1592 | atomic64_set(&ioc->vtime_rate, vrate); | 1593 | atomic64_set(&ioc->vtime_rate, vrate); |
1593 | ioc->inuse_margin_vtime = DIV64_U64_ROUND_UP( | 1594 | ioc->inuse_margin_vtime = DIV64_U64_ROUND_UP( |
1594 | ioc->period_us * vrate * INUSE_MARGIN_PCT, 100); | 1595 | 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); | ||
1595 | } | 1600 | } |
1596 | 1601 | ||
1597 | ioc_refresh_params(ioc, false); | 1602 | ioc_refresh_params(ioc, false); |