top/ps CPU percentage broken on 7.1-PRERELEASE?

Stefan Ehmann shoesoft at gmx.net
Fri Oct 3 08:03:18 UTC 2008


The CPU % displayed by top/ps for single processes seem to be broken here.

E.g. for a simple shell loop:
top starts displaying around 20% for bash. Within some seconds it converges to 
0%.

ps values seem to be consistent with top.

The value in the time column seems to be correct. On every refresh it 
increases by 2s.

last pid: 19353;  load averages:  0.99,  0.90,  0.76  up 0+00:37:29    
09:07:00
119 processes: 2 running, 114 sleeping, 1 stopped, 2 zombie
CPU: 98.5% user,  0.0% nice,  1.1% system,  0.4% interrupt,  0.0% idle
Mem: 376M Active, 407M Inact, 144M Wired, 47M Cache, 110M Buf, 13M Free
Swap: 1280M Total, 1280M Free

  PID USERNAME    THR PRI NICE   SIZE    RES STATE    TIME   WCPU COMMAND
19352 stefan        1  99    0  4432K  2080K RUN      0:03 15.48% bash

All other process are using 0% CPU.

I did a buildworld/kernel yesterday to be sure everything is in sync. I have  
CURRENT on a different hard disk. Haven't seen the problem there.
Are there any relevant fixes that weren't MFCed?

Does anyone else see this? This is a single CPU i386 machine.

-- 
Stefan


More information about the freebsd-stable mailing list