mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Tom Holroyd <tomh@po.crl.go.jp>
Cc: Tim Schmielau <tim@physik3.uni-rostock.de>,
	kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: Unknown HZ value! (1908) Assume 1024.
Date: Tue, 19 Feb 2002 11:47:30 +0100	[thread overview]
Message-ID: <jeheod929p.fsf@sykes.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0202191000030.26361-100000@holly.crl.go.jp>
In-Reply-To: <Pine.LNX.4.44.0202191000030.26361-100000@holly.crl.go.jp> (Tom Holroyd's message of "Tue, 19 Feb 2002 10:47:34 +0900 (JST)")

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."

  parent reply	other threads:[~2002-02-19 10:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-18  8:08 Tom Holroyd
2002-02-18 21:41 ` Tim Schmielau
2002-02-19  1:47   ` Tom Holroyd
2002-02-19  9:05     ` Tim Schmielau
2002-02-19  9:29       ` Tom Holroyd
2002-02-19  9:43         ` Tim Schmielau
2002-02-19 10:47     ` Andreas Schwab [this message]
2002-02-20  2:10       ` Tom Holroyd
2002-02-20  9:58         ` Tim Schmielau
2002-04-01  8:28           ` Albert D. Cahalan
2002-04-02 12:08             ` Tim Schmielau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jeheod929p.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tim@physik3.uni-rostock.de \
    --cc=tomh@po.crl.go.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®