Recently, I upgraded my ubuntu host from 16.04 to 20.04 version. After the host upgrade, the upgraded lxc version is 4.0.2 and lxcfs is 4.0.3.
In the upgraded host, the host started to receive lxcfs syslog errors like this for every few seconds for all the containers
May 18 22:25:00 us-host4 lxcfs[2201]: proc_fuse.c: 876: proc_stat_read: cpuX from /lxc.payload.app1 has unexpected cpu time: 23457536 in /proc/stat, 23484514 in cpuacct.usage_all; unable to determine idle time
May 18 22:25:00 us-host4 lxcfs[2201]: proc_fuse.c: 876: proc_stat_read: cpuX from /lxc.payload.app1 has unexpected cpu time: 23409824 in /proc/stat, 23484757 in cpuacct.usage_all; unable to determine idle time
May 18 22:25:00 us-host4 lxcfs[2201]: proc_fuse.c: 876: proc_stat_read: cpuX from /lxc.payload.app1 has unexpected cpu time: 23427791 in /proc/stat, 23512092 in cpuacct.usage_all; unable to determine idle time
May 18 22:25:00 us-host4 lxcfs[2201]: proc_fuse.c: 876: proc_stat_read: cpuX from /lxc.payload.app1 has unexpected cpu time: 23410695 in /proc/stat, 23527624 in cpuacct.usage_all; unable to determine idle time
May 18 22:25:00 us-host4 lxcfs[2201]: proc_fuse.c: 876: proc_stat_read: cpuX from /lxc.payload.app1 has unexpected cpu time: 23417370 in /proc/stat, 23546309 in cpuacct.usage_all; unable to determine idle time
@brauner I just edited that particular text cpuX . Sorry for that.
Here is the logs with actual CPU numbers
May 18 22:25:00 us-host4 lxcfs[2201]: proc_fuse.c: 876: proc_stat_read: cpu33 from /lxc.payload.app1 has unexpected cpu time: 23457536 in /proc/stat, 23484514 in cpuacct.usage_all; unable to determine idle time
May 18 22:25:00 us-host4 lxcfs[2201]: proc_fuse.c: 876: proc_stat_read: cpu34 from /lxc.payload.app1 has unexpected cpu time: 23409824 in /proc/stat, 23484757 in cpuacct.usage_all; unable to determine idle time
May 18 22:25:00 us-host4 lxcfs[2201]: proc_fuse.c: 876: proc_stat_read: cpu35 from /lxc.payload.app1 has unexpected cpu time: 23427791 in /proc/stat, 23512092 in cpuacct.usage_all; unable to determine idle time
May 18 22:25:00 us-host4 lxcfs[2201]: proc_fuse.c: 876: proc_stat_read: cpu36 from /lxc.payload.app1 has unexpected cpu time: 23410695 in /proc/stat, 23527624 in cpuacct.usage_all; unable to determine idle time
May 18 22:25:00 us-host4 lxcfs[2201]: proc_fuse.c: 876: proc_stat_read: cpu37 from /lxc.payload.app1 has unexpected cpu time: 23417370 in /proc/stat, 23546309 in cpuacct.usage_all; unable to determine idle time
It can happen on very busy containers or those hitting lxcfs particularly hard.
The kernel API for this is inherently racy and when such a race is hit, lxcfs logs it.
@stgraber@brauner FYI, these logs are coming only in the upgraded ubuntu lxc host from 16.04 to 20.04 or from 18.04 to 20.04. In the fresh install of Ubuntu 20.04, using lxcfs version 4.0.3 doesn’t give these errors.