CPU load
Quoted 4 lines · Vassili Karpov
How does the kernel calculates the value it places in `/proc/stat' at 4th position (i.e. "idle: twiddling thumbs")?
..
Quoted 5 lines
Later small kernel module was developed that tried to time how much time is spent in the idle handler inside the kernel and exported this information to the user-space. The results were consistent with our expectations and the output of the test utility.
..
Quoted 1 line
Vassili
Could you rewrite this code as a kernel patch for discussion/inclusion in mainline? I and maybe others would appreciate having idle statistics be more accurate.
Thanks for your work
Andrew
Quoted 11 lines · Andrew Burgess
Quoted 4 lines · Vassili Karpov
How does the kernel calculates the value it places in `/proc/stat' at 4th position (i.e. "idle: twiddling thumbs")?
..
Quoted 5 lines
Later small kernel module was developed that tried to time how much time is spent in the idle handler inside the kernel and exported this information to the user-space. The results were consistent with our expectations and the output of the test utility.
Quoted 8 lines
..
Quoted 1 line
Vassili
Could you rewrite this code as a kernel patch for discussion/inclusion in mainline? I and maybe others would appreciate having idle statistics be more accurate.
I really don't know how to approach that, what i do in itc.c is ugly to say the least (it's less ugly on PPC, but still).
There's stuff there that is very dangerous, i.e. entering idle handler on SMP and simultaneously rmmoding the module (which surprisingly never actually caused any bad things on kernels i had (starting with 2.6.17.3), but paniced on Debians 2.6.8). Safety nets were added but i don't know whether they are sufficient. All in all what i have is a gross hack, but it works for my purposes.
Another thing that keeps bothering me (again discovered with this Debian kernel) is the fact that PREEMPT preempts idle handler, this just doesn't add up in my head.
So to summarize: i don't know how to properly do that (so that it works on all/most architectures, is less of a hack, has no negative impact on performance, etc)
But i guess what innocent `smallhog.c' posted earlier demonstrated - is that something probably ought to be done about it, or at least the current situation documented.
Signature · 1 line
vale