Skip to content

Commit 1bf6ece

Browse files
Chengming Zhouaxboe
authored andcommitted
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 <[email protected]> Acked-by: Tejun Heo <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent d9012a5 commit 1bf6ece

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/cgroup/iocost_monitor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def __init__(self, iocg):
173173
self.usages = []
174174
self.usage = 0
175175
for i in range(NR_USAGE_SLOTS):
176-
usage = iocg.usages[(usage_idx + i) % NR_USAGE_SLOTS].value_()
176+
usage = iocg.usages[(usage_idx + 1 + i) % NR_USAGE_SLOTS].value_()
177177
upct = usage * 100 / HWEIGHT_WHOLE
178178
self.usages.append(upct)
179179
self.usage = max(self.usage, upct)

0 commit comments

Comments
 (0)