diff options
author | Baolin Wang <baolin.wang@linux.alibaba.com> | 2020-10-08 11:52:24 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-10-08 08:01:37 -0600 |
commit | b185efa78bf9f13e32f115169e4ab35e68993461 (patch) | |
tree | 2105d757567545656425bcbba626810ac496c734 /block/blk-throttle.c | |
parent | 7901601aef35082d8431d05ab50a3567f7624b55 (diff) | |
download | linux-b185efa78bf9f13e32f115169e4ab35e68993461.tar.gz linux-b185efa78bf9f13e32f115169e4ab35e68993461.tar.bz2 linux-b185efa78bf9f13e32f115169e4ab35e68993461.zip |
blk-throttle: Avoid tracking latency if low limit is invalid
The IO latency tracking is only for LOW limit, so we should add a
validation to avoid redundant latency tracking if the LOW limit
is not valid.
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-throttle.c')
-rw-r--r-- | block/blk-throttle.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 7e72102aa918..b0d8f7cc5e92 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -2100,7 +2100,7 @@ static void throtl_update_latency_buckets(struct throtl_data *td) unsigned long last_latency[2] = { 0 }; unsigned long latency[2]; - if (!blk_queue_nonrot(td->queue)) + if (!blk_queue_nonrot(td->queue) || !td->limit_valid[LIMIT_LOW]) return; if (time_before(jiffies, td->last_calculate_time + HZ)) return; @@ -2338,6 +2338,8 @@ void blk_throtl_bio_endio(struct bio *bio) if (!blkg) return; tg = blkg_to_tg(blkg); + if (!tg->td->limit_valid[LIMIT_LOW]) + return; finish_time_ns = ktime_get_ns(); tg->last_finish_time = finish_time_ns >> 10; |