Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jun 2009 01:47:46 GMT
From:      Yuri <yuri@tsoft.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/135823: 'top' shows wrong CPU usage for multithreaded applications
Message-ID:  <200906190147.n5J1lkcN053428@www.freebsd.org>
Resent-Message-ID: <200906190150.n5J1o1Ni021299@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         135823
>Category:       kern
>Synopsis:       'top' shows wrong CPU usage for multithreaded applications
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 19 01:50:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Yuri
>Release:        72-STABLE
>Organization:
n/a
>Environment:
>Description:
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:
<quote>
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).
</quote>

This is a serious bug preventing user to see the very basic property of the running processes.

>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906190147.n5J1lkcN053428>