You are not logged in.

#1 2010-08-09 22:07:03

cgarcia
Member
Registered: 2010-08-09
Posts: 39

Important kernel 2.6.33/34/35 bug

Using the kernels 2.6.33, 2.6.34 and 2.6.35, the getrusage() function may consistently (and incorrectly) report the User CPU time as System time. This does not occurs with kernel-lsb (2.6.32). I detected this behaviour when a GNU gmp library benchmark reported wrong results, and finally tracked it down up to detecting the wrong /proc/PID/stat filesystem information (/proc/stat is correctly updated). This has been tested in the 3 mentioned Arch kernels in different machines (Core 2 Duo, Pentium 4 and Intel Atom).

Steps to reproduce it:

1) Make a tiny C program doing a infinite loop and run it.

2) Examine /proc/PID/stat:
   - After 2-4 minutes, the User CPU time becomes stalled (in a value from about 15000 to 25000) and will never increase again.
   - The System CPU time incorrectly begins to increase, reporting 100% of the CPU ticks.
   - However /proc/stat correctly continues reporting the CPU being spent as User time.
   - Stopping and resuming the process does not restores the proper function.

In example bellow, the user time becomes freezed at "21533" after just 215.33 seconds. I assume that this is a upstream bug, but at this moment I have no other computer with a 2.6.33/34/35 kernel from another Linux distribution to test this. If you have, it could be interesting to confirm it before submitting a kernel bug. This problem is here since a lot of months and could affect more software than mere benchmarks.

ciri@quark:/proc/12096$ cat stat | awk '{ print $14 " " $15 }' ; head -1 ../stat | awk '{ print $2 " " $4 }' ; date
20549 21
116668 6587
Mon Aug  9 23:53:53 CEST 2010

ciri@quark:/proc/12096$ cat stat | awk '{ print $14 " " $15 }' ; head -1 ../stat | awk '{ print $2 " " $4 }' ; date
21533 21
117656 6588
Mon Aug  9 23:54:03 CEST 2010

ciri@quark:/proc/12096$ cat stat | awk '{ print $14 " " $15 }' ; head -1 ../stat | awk '{ print $2 " " $4 }' ; date
21533 639
118275 6589
Mon Aug  9 23:54:09 CEST 2010

ciri@quark:/proc/12096$ cat stat | awk '{ print $14 " " $15 }' ; head -1 ../stat | awk '{ print $2 " " $4 }' ; date
21533 1795
119434 6590
Mon Aug  9 23:54:20 CEST 2010

ciri@quark:/proc/12096$ cat stat | awk '{ print $14 " " $15 }' ; head -1 ../stat | awk '{ print $2 " " $4 }' ; date
21533 16337
134138 6670
Mon Aug  9 23:56:46 CEST 2010

Offline

#2 2010-08-10 12:52:46

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Important kernel 2.6.33/34/35 bug

You really should report this upstream smile.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

Board footer

Powered by FluxBB