summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorKemeng Shi <shikemeng@huawei.com>2022-10-18 15:19:31 +0300
committerJens Axboe <axboe@kernel.dk>2022-12-01 17:44:12 +0300
commit6c31be320c52bad07e0317d2565ae8a4e5dab03b (patch)
tree8d37db5629bd53d74eaa4f96615adaaa1ba8baab /block
parent63c9eac4b6d75859703f5820414986edefb01210 (diff)
downloadlinux-6c31be320c52bad07e0317d2565ae8a4e5dab03b.tar.xz
blk-iocost: Remove vrate member in struct ioc_now
If we trace vtime_base_rate instead of vtime_rate, there is nowhere which accesses now->vrate except function ioc_now using now->vrate locally. Just remove it. Signed-off-by: Kemeng Shi <shikemeng@huawei.com> Acked-by: Tejun Heo <tj@kernel.org> Link: https://lore.kernel.org/r/20221018121932.10792-5-shikemeng@huawei.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-iocost.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index f57a84ff0244..1b1a2d0f5564 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -556,7 +556,6 @@ struct ioc_now {
u64 now_ns;
u64 now;
u64 vnow;
- u64 vrate;
};
struct iocg_wait {
@@ -1020,10 +1019,11 @@ static void ioc_adjust_base_vrate(struct ioc *ioc, u32 rq_wait_pct,
static void ioc_now(struct ioc *ioc, struct ioc_now *now)
{
unsigned seq;
+ u64 vrate;
now->now_ns = ktime_get();
now->now = ktime_to_us(now->now_ns);
- now->vrate = atomic64_read(&ioc->vtime_rate);
+ vrate = atomic64_read(&ioc->vtime_rate);
/*
* The current vtime is
@@ -1036,7 +1036,7 @@ static void ioc_now(struct ioc *ioc, struct ioc_now *now)
do {
seq = read_seqcount_begin(&ioc->period_seqcount);
now->vnow = ioc->period_at_vtime +
- (now->now - ioc->period_at) * now->vrate;
+ (now->now - ioc->period_at) * vrate;
} while (read_seqcount_retry(&ioc->period_seqcount, seq));
}