kern/135823: 'top' shows wrong CPU usage for multithreaded
yuri at tsoft.com
Fri Jun 19 01:50:02 UTC 2009
>Synopsis: 'top' shows wrong CPU usage for multithreaded applications
>Arrival-Date: Fri Jun 19 01:50:01 UTC 2009
I ran the program with 1500 threads and in top it looked the this:
> PID USERNAME THR PRI NICE SIZE RES STATE C TIME CPU COMMAND
> 20382 yuri 1500 99 0 641M 462M umtxn 0 0:00 19623.14% quicksort
> <skipped further>
I discussed this in freebsd-hackers@ and got this response from Dan Nelson:
Top doesn't seem to show the right %CPU at all for threaded apps unless you
hit H to view each thread individually. Then you get accurate numbers (but
you have to manually sum up the threads usage if you want to see the total
%CPU for an entire process).
This is a serious bug preventing user to see the very basic property of the running processes.
More information about the freebsd-bugs