Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 14966 - procps outputting incorrect CPU time/usage values
Summary: procps outputting incorrect CPU time/usage values
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Brandon Low (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-02 06:46 UTC by Décio Luiz Gazzoni Filho
Modified: 2003-03-01 15:33 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Décio Luiz Gazzoni Filho 2003-02-02 06:46:33 UTC
This is an example output of top on my machine, a dual Athlon 1533 MHz: 
 
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  Command 
 8641 root      24  -1 26540  25m 1308 R 99.9  2.6  11047:39 gp 
24517 pcarmody  35  10  2564 2112  880 R 99.9  0.2  33231:39 pfgw-linux-2002 
16259 root      39  19 73048  71m  624 R 99.9  7.1  10:43.24 linesiever 
14932 root      39  19 73044  71m  624 R 59.5  7.1  33:42.55 linesiever 
16371 root      16   0   912  912  680 R 52.6  0.1   0:00.63 top 
 
By the way, the machine's current uptime is: 
 
 09:38:39 up 2 days, 21:32,  6 users,  load average: 4.03, 4.10, 4.10 
 
So obviously I couldn't be running processes for 23 days or so as indicated by top. 
 
Also, I'm not sure whether top is supposed to display total CPU usage/number of CPUs (i.e. all 
fields should sum to 100%) or just added CPU usage of both processors (should sum to 200%), 
but either way, this is summing to more than 400%. The command ps suffers from the same 
problems. 
 
I have reasons to believe this is related to the ``Set jiffies for i386 (HZ)'' kernel config option. 
Mine is set at 1000. 

Reproducible: Always
Steps to Reproduce:
1.
2.
3.



Portage 2.0.46-r9 (default-x86-1.4, gcc-3.2.1, glibc-2.3.1-r3) 
================================================================= 
System uname: 2.4.19-gentoo-r10 i686 AMD Athlon(tm) MP 1800+ 
GENTOO_MIRRORS="http://www.ibiblio.org/pub/Linux/distributions/gentoo" 
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3.1/share/config 
/usr/kde/3/share/config /usr/share/config" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" 
PORTDIR="/usr/portage" 
DISTDIR="/usr/portage/distfiles" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR_OVERLAY="" 
USE="x86 oss 3dnow apm avi crypt cups encode gif jpeg libg++ mmx mpeg ncurses nls pdflib 
png qtmt quicktime spell truetype xml2 xmms xv zlib gdbm berkdb slang readline tetex aalib 
svga tcltk java postgres X sdl gpm tcpd pam libwww ssl perl python imlib oggvorbis gtk qt kde 
motif opengl mozilla cdr dvd ipv6 mule sse -gnome -mikmod -arts" 
COMPILER="gcc3" 
CHOST="i686-pc-linux-gnu" 
CFLAGS="-O3 -march=athlon-xp -pipe -fomit-frame-pointer -O3 " 
CXXFLAGS="-O3 -march=athlon-xp -pipe -fomit-frame-pointer -O3 " 
ACCEPT_KEYWORDS="x86 ~x86" 
MAKEOPTS="-j4" 
AUTOCLEAN="true" 
SYNC="rsync://rsync.gentoo.org/gentoo-portage" 
FEATURES="sandbox ccache"
Comment 1 Brandon Low (RETIRED) gentoo-dev 2003-02-02 15:31:16 UTC
Yes, this is due to the HZ value being set to 1000, upgrading to gentoo-sources-2.4.20-r1 will fix it as the variable HZ option has been removed from that patchset for the time being.  There is a newer variable HZ patch which theoretically will work correctly, and I am testing it for future kernels.
Comment 2 Brandon Low (RETIRED) gentoo-dev 2003-03-01 15:33:44 UTC
IF I'm wrong, reopen.