iocost: protect iocg->abs_vdebt with iocg->waitq.lock
[sfrench/cifs-2.6.git] / tools / cgroup / iocost_monitor.py
index 7427a5ee761b3757feaf04ff76bf3afd7a91a90c..9d8e9613008a99c4998db7d9bfd8ac4c88cf0575 100644 (file)
@@ -159,7 +159,12 @@ class IocgStat:
         else:
             self.inflight_pct = 0
 
-        self.debt_ms = iocg.abs_vdebt.counter.value_() / VTIME_PER_USEC / 1000
+        # vdebt used to be an atomic64_t and is now u64, support both
+        try:
+            self.debt_ms = iocg.abs_vdebt.counter.value_() / VTIME_PER_USEC / 1000
+        except:
+            self.debt_ms = iocg.abs_vdebt.value_() / VTIME_PER_USEC / 1000
+
         self.use_delay = blkg.use_delay.counter.value_()
         self.delay_ms = blkg.delay_nsec.counter.value_() / 1_000_000