forked from luck/tmp_suning_uos_patched
iocost_monitor: start from the oldest usage index
iocg usage_idx is the latest usage index, we should start from the oldest usage index to show the consecutive NR_USAGE_SLOTS usages. Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
d9012a59db
commit
1bf6ece573
|
@ -173,7 +173,7 @@ class IocgStat:
|
|||
self.usages = []
|
||||
self.usage = 0
|
||||
for i in range(NR_USAGE_SLOTS):
|
||||
usage = iocg.usages[(usage_idx + i) % NR_USAGE_SLOTS].value_()
|
||||
usage = iocg.usages[(usage_idx + 1 + i) % NR_USAGE_SLOTS].value_()
|
||||
upct = usage * 100 / HWEIGHT_WHOLE
|
||||
self.usages.append(upct)
|
||||
self.usage = max(self.usage, upct)
|
||||
|
|
Loading…
Reference in New Issue
Block a user