It's not userspace, this is a kernel problem (proc_misc.c):
cpu 2427984276 2540057284 67737892 4296620451
cpu0 2427984276 2540057284 67737892 4296620451
Unknown HZ value! (1897) Assume 1024.
procps version 2.0.2
All the tools that give me that message are in procps. I tried it
with procps 2.0.7 and it still happens. The message is coming from
sysinfo.c in the libproc part of that package. What it does is, it
takes the "cpu" line from /proc/stat, and adds up all the numbers, and
then divides by the value in /proc/uptime. So it gets:
2427984276 + 2540057284 + 67737892 + 4296620451 = 9332399903
9332399903 / 4919324.13 = 1897 (wrong)
Apparently, that 4th value in /proc/stat is bogus. If I do:
2427984276 + 2540057284 + 67737892 = 5035779452
5035779452 / 4919324.13 = 1023.67 (close enough)
So what is the 4th value in /proc/stat (procps calls it "other", while
the first 3 are "user", "nice", and "sys")? According to
linux/fs/proc/proc_misc.c, it is:
jif * smp_num_cpus - (user + nice + system)
formatted with a %lu (the others are just %u). smp_num_cpus is 1.
Things are declared this way:
unsigned long jif = jiffies;
unsigned int sum = 0, user = 0, nice = 0, system = 0;
So, the problem is that user + nice + system overflows (I'm compiling
with gcc 3.0, BTW).
Thanks for the clue; now, how to fix it?
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to email@example.com
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/