From owner-freebsd-bugs@FreeBSD.ORG Fri Jun 19 01:50:02 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6741B1065672 for ; Fri, 19 Jun 2009 01:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2805F8FC0C for ; Fri, 19 Jun 2009 01:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n5J1o2EL021300 for ; Fri, 19 Jun 2009 01:50:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n5J1o1Ni021299; Fri, 19 Jun 2009 01:50:02 GMT (envelope-from gnats) Resent-Date: Fri, 19 Jun 2009 01:50:02 GMT Resent-Message-Id: <200906190150.n5J1o1Ni021299@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Yuri Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D57D1065670 for ; 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 ; 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 ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/135823: 'top' shows wrong CPU usage for multithreaded applications X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2009 01:50:02 -0000 >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 > > 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. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: