Re: broken top stats

From: Dan Nelson <dnelson_at_allantgroup.com>
Date: Sun, 14 Mar 2004 15:31:38 -0600
In the last episode (Mar 14), Artem Ignatiev said:
> options SCHED_ULE
> (cvsupped just before rebuilding kernel & world)
>
> top gives weird CPU/WCPU usage: only first (rarely, first couple) of
> processes displayed have non-zero CPU/WCPU usage, all others have
> zero cpu usage, but totals, shown in second line of top output
> differs from sum of values in CPU column alot. Same with ps. E.g.:
> 
> 51 processes:  2 running, 49 sleeping
> CPU: 20.2% user,  0.0% nice,  3.5% system,  2.3% interrupt, 74.0% idle
> Mem: 168M Active, 141M Inact, 98M Wired, 716K Cache, 60M Buf, 91M Free
> Swap: 231M Total, 231M Free
> 
>   PID USERNAME PRI NICE   SIZE    RES STATE    TIME   WCPU    CPU CMD
>  1363 timon     77    0 49544K 42140K RUN      1:11  6.25%  6.25% mozill
>   890 timon     77    0   100M 83152K select   1:21  3.12%  3.12% XFree8
>  1344 timon     20    0 16184K 13144K kserel   1:55  0.00%  0.00% xmms
>   918 timon     20    0 78616K 50344K kserel   0:44  0.00%  0.00% evolut
>   901 timon     76    0  5556K  2604K select   0:25  0.00%  0.00% wmusic
>   919 timon     20    0 41304K 37836K kserel   0:21  0.00%  0.00% pan

There is a bug in the kernel threads code that does not total up all
the kthread's CPU stats when a program asks for just process stats.  It
just pulls the first one.  If you hit 'H', you should see some extra
threads for each of those 0-cpu processes, and they should have
non-zero CPU.  Also, SCHED_ULE doesn't update WCPU at all (it just
copies CPU).

-- 
	Dan Nelson
	dnelson_at_allantgroup.com
Received on Sun Mar 14 2004 - 12:31:40 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:47 UTC