Kernel update bug in /proc/stat

asked 2014-06-26 00:59:54 +0200

Almindor gravatar image

updated 2014-07-16 21:48:43 +0200

It seems that the latest update has broken /proc/stat reporting of CPU usage.

The cpu line's iowait and idle column values jump down between ticks, usually when the CPU starts to get busy. This is not normal, I confirmed with linux kernel devs that these values should never go down, only up since they represent jiffies spent on given activity.

This causes programs like top to report errorenous CPU usages (I get 2700% at times for example) and breaks all apps reporting CPU usage too.

I found this out because my app measures CPU usage.

Here's an example of 2 subsequent readings of /proc/stat (using just bash loop with cat and grep)

cpu 68399 3711 69248 1476309 46342 8 360 0 0 0

cpu 68406 3712 69254 1405524 38397 8 360 0 0 0

The 4th and 5th data columns (iowait and idle) have a visible drop.

I noticed that it's caused mostly by the second CPU's values dropping to almost 0 values (this reading is for "overall cpu").

example of top reading when bug apparent: image description

NOTE: issue still present in the latest release

edit retag flag offensive close delete

Comments

1

This could explain why I see sometimes continuous high CPU usage with Crest (5 - 10 %) which is not consistent with the slow decrease of the battery, about 1% every 2-3 hours.

Jordi ( 2014-06-26 01:30:28 +0200 )edit

We have managed to reproduce this, seems to happen when we resume the cpu's from sleep. A potential fix is now being tested.

Philippe De Swert ( 2014-10-07 23:37:11 +0200 )edit