Tom Holroyd <tomh@po.crl.go.jp> writes:
|> 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?
Changing the line to this:
jif * smp_num_cpus - user - nice - system
should avoid the overflow.
Andreas.
-- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sat Feb 23 2002 - 21:00:19 EST