From owner-freebsd-stable@FreeBSD.ORG Thu Aug 17 17:11:45 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B427C16A4EC for ; Thu, 17 Aug 2006 17:11:45 +0000 (UTC) (envelope-from b.j.casavant@ieee.org) Received: from yeppers.tdkt.org (skyline.tdkt.org [209.98.211.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B76943E19 for ; Thu, 17 Aug 2006 17:11:20 +0000 (GMT) (envelope-from b.j.casavant@ieee.org) Received: from pkunk.americas.sgi.com (cfcafwp.sgi.com [192.48.179.6]) (authenticated bits=0) by yeppers.tdkt.org (8.12.11/8.12.11/erikj-OpenBSD) with ESMTP id k7HHBAcf011752; Thu, 17 Aug 2006 12:11:17 -0500 (CDT) Date: Thu, 17 Aug 2006 12:11:03 -0500 (CDT) From: Brent Casavant X-X-Sender: bcasavan@pkunk.americas.sgi.com To: Chuck Swiger In-Reply-To: <5C8C1B11-DE0B-4FE2-9A3D-5472650B9FA8@mac.com> Message-ID: <20060817120221.D20436@pkunk.americas.sgi.com> References: <44E1F796.5070105@rogers.com> <20060815172728.GB88051@dan.emsphone.com> <44E204C0.60806@rogers.com> <44E3FE61.6060800@lefebvre.org> <5C8C1B11-DE0B-4FE2-9A3D-5472650B9FA8@mac.com> Organization: Angeltread Software Organization MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Bill LeFebvre , freebsd-stable@freebsd.org Subject: Re: TOP shows above 100% WCPU usage X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Brent Casavant List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 17:11:45 -0000 On Thu, 17 Aug 2006, Chuck Swiger wrote: > On Aug 16, 2006, at 10:28 PM, Bill LeFebvre wrote: > > > > You have multiple CPUs, so a threaded process can theoretically reach > > > > 100*ncpus cpu usage. > > > > > > > Ahh, thats makes sense, thanks. > > > > Actually it doesn't. IMO, %CPU should be biased for all available cpu, not > > just a single cpu. In other words, a single-threaded process running on a > > two processor box should never see more than 50% cpu. That's how top > > computes it for SunOS. But for freebsd top only displays whats in the proc > > structure and I don't know off-hand how the kernel records it. > > You've got a good point here. In particular, consider the case where you have > an SMP machine where not all of the CPUs are running at the same clock > rate...100% of one CPU is not the same level of processing as 100% of another. Note that IRIX's top does not bias for availabile CPUs -- I've seen well-threaded programs using in excess of 2400% CPU. What it comes down to is that depending on the nature of the information you're trying to glean from WCPU, you may want either view of the data. Some versions of top on Linux allow you to switch between IRIX and Solaris views. From the help screen for top from procps 3.2.6 on Linux: 1,I Toggle SMP view: '1' single/separate states; 'I' Irix/Solaris mode There's really not a clear cut right and wrong here, particularly if your version of top is able to display per-thread instead of per-process data. Sometimes you want to break out individual threads and see their level of CPU utilization (the IRIX view is most useful), sometimes you want to get a handle on which processes are loading down a machine (the Solaris view is most useful). Brent Casavant -- Brent Casavant Dance like everybody should be watching. www.angeltread.org KD5EMB, EN34lv