From nobody@FreeBSD.org  Fri Jun 19 01:47:46 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8D57D1065670
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 19 Jun 2009 01:47:46 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 7B8958FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 19 Jun 2009 01:47:46 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n5J1lkTa053429
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 19 Jun 2009 01:47:46 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n5J1lkcN053428;
	Fri, 19 Jun 2009 01:47:46 GMT
	(envelope-from nobody)
Message-Id: <200906190147.n5J1lkcN053428@www.freebsd.org>
Date: Fri, 19 Jun 2009 01:47:46 GMT
From: Yuri <yuri@tsoft.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: 'top' shows wrong CPU usage for multithreaded applications
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         135823
>Category:       kern
>Synopsis:       top(1) shows wrong CPU usage for multithreaded applications
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 19 01:50:01 UTC 2009
>Closed-Date:    Fri Jul 08 14:28:50 UTC 2011
>Last-Modified:  Fri Jul 08 14:28:50 UTC 2011
>Originator:     Yuri
>Release:        7.2-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:

From: Andrew Brampton <brampton+freebsd@gmail.com>
To: bug-followup@FreeBSD.org, yuri@tsoft.com
Cc:  
Subject: Re: kern/135823: top(1) shows wrong CPU usage for multithreaded 
	applications
Date: Wed, 7 Oct 2009 11:15:39 +0100

 This is a duplicate of bin/127331 where it has already been fixed.
State-Changed-From-To: open->closed 
State-Changed-By: arundel 
State-Changed-When: Fri Jul 8 14:27:13 UTC 2011 
State-Changed-Why:  
Duplicate of bin/127331. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135823 
>Unformatted:
