blk-iocost: make ioc_now->now and ioc->period_at 64bit
authorTejun Heo <tj@kernel.org>
Tue, 1 Sep 2020 18:52:40 +0000 (14:52 -0400)
committerJens Axboe <axboe@kernel.dk>
Wed, 2 Sep 2020 01:38:32 +0000 (19:38 -0600)
They are in microseconds and wrap in around 1.2 hours with u32. While
unlikely, confusions from wraparounds are still possible. We aren't saving
anything meaningful by keeping these u32. Let's make them u64.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-iocost.c

index 00c5a3ad2b5b63cc2c93373cf148896afa13644d..dc72cd9658371a3319ace110ce7d8700e15e26a7 100644 (file)
@@ -409,7 +409,7 @@ struct ioc {
        atomic64_t                      vtime_rate;
 
        seqcount_spinlock_t             period_seqcount;
-       u32                             period_at;      /* wallclock starttime */
+       u64                             period_at;      /* wallclock starttime */
        u64                             period_at_vtime; /* vtime starttime */
 
        atomic64_t                      cur_period;     /* inc'd each period */
@@ -508,7 +508,7 @@ struct ioc_cgrp {
 
 struct ioc_now {
        u64                             now_ns;
-       u32                             now;
+       u64                             now;
        u64                             vnow;
        u64                             vrate;
 };