Bug 1376 - /proc/vz/vestat and /proc/stat (inside container) sometimes reports bad value for idle and wait
/proc/vz/vestat and /proc/stat (inside container) sometimes reports bad value...
Status: CLOSED FIXED
Product: OpenVZ
Classification: Unclassified
Component: kernel
rhel6-2.6.32_042stabXXX
x86_64 (AMD64) All
: P2 normal
Assigned To: Vladimir Davydov
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-12-01 13:45 EST by Jon Kolb
Modified: 2015-03-16 10:02 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Kolb 2009-12-01 13:45:02 EST
I'm trying to write a perl collectd plugin to track resource usage for openvz containers.  The host is Debian lenny running kernel 2.6.26-2-openvz-amd64 on an Atom 230 processor.  The guest is also Debian lenny amd64.  Every once in a while, when running 'vzctl <veid> exec cat /proc/stat', the value for idle on cpu0 will be 48485, wait will have a value somewhat lower than the previous (10 seconds prior) reading for cpu0 idle, and the remaining values in the line will all be 0.  On the next reading, all values will be what I expect.

example:

veid: 101
  cpu-0: user: 34200 nice: 39258 system: 39269 idle: 33410749 wait: 5961 interrupt: 0 softirq: 0 steal: 0
  cpu-1: user: 23359 nice: 12880 system: 21009 idle: 129 wait: 0 interrupt: 0 softirq: 0 steal: 0
veid: 101
  cpu-0: user: 34200 nice: 39259 system: 39270 idle: 48485 wait: 33369476 interrupt: 0 softirq: 0 steal: 0
  cpu-1: user: 23359 nice: 12880 system: 21012 idle: 129 wait: 0 interrupt: 0 softirq: 0 steal: 0
veid: 101
  cpu-0: user: 34201 nice: 39260 system: 39274 idle: 33413248 wait: 5961 interrupt: 0 softirq: 0 steal: 0
  cpu-1: user: 23412 nice: 12881 system: 21022 idle: 129 wait: 0 interrupt: 0 softirq: 0 steal: 0
Comment 1 Jon Kolb 2009-12-01 16:00:28 EST
Not sure if it's related, but often, cpu0 will log more idle ticks elapsed between two readings than possible (usually around 1.2x real time).  If I ignore the 48485 readings, cpu0's idle will average 120-130%, and cpu1 doesn't increase as much as it should (though I haven't looked to see if it's the same amount).
Comment 2 Pavel Emelyanov 2009-12-02 05:18:47 EST
To Kostja
Comment 3 Artur Cichocki 2011-10-21 06:25:13 EDT
I can confirm it on CentOS 6, 2.6.32-042stab039.3, x86_64.

host: /proc/vz/vestat (look at Idle)
                1104              1808967                    0               526018              6863835       17489739484870                    0        6863842667020        2459967310094                    0                    
                1104              1808968                    0               526024              6864674       17475201606990                    0        6864682347610        2459975107106                    0                    0                    0

container: /proc/stat
cpu  180869 0 52594 1745699 48685 0 0 0
cpu  180869 0 52594 1742444 48685 0 0 0


Dell R410, Dual Xeon E5645.
Comment 4 Yasuyuki Nakamura 2012-03-15 05:53:02 EDT
I think this bug is related with Bug 2179 (or it seems same bug).
sorry for reporting duplicated bug.

Do you have any idea to fix this issue?
Comment 5 Yasuyuki Nakamura 2012-04-10 04:33:10 EDT
any news?
Comment 6 Konstantin Khlebnikov 2012-06-14 06:45:12 EDT
[Add vdavydov@parallels.com to CC]
Comment 7 Vladimir Davydov 2012-06-14 06:46:30 EDT
Try 042stab056.11
Comment 8 Konstantin Khlebnikov 2012-12-17 04:26:09 EST
Try recent kernels and reopen if bug still here.
Comment 9 Sergey Bronnikov 2015-03-16 10:02:01 EDT
Bug was fixed more than one year ago and there were no complains from reporter after fix. We treat bug as fixed and close bug.