From owner-freebsd-questions@FreeBSD.ORG Mon Nov 2 21:34:37 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 424AD106568B for ; Mon, 2 Nov 2009 21:34:37 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email1.allantgroup.com (email1.emsphone.com [199.67.51.115]) by mx1.freebsd.org (Postfix) with ESMTP id E165F8FC15 for ; Mon, 2 Nov 2009 21:34:36 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by email1.allantgroup.com (8.14.0/8.14.0) with ESMTP id nA2LYX25029316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 2 Nov 2009 15:34:33 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.3/8.14.3) with ESMTP id nA2LYXbj041018 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 2 Nov 2009 15:34:33 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.3/8.14.3/Submit) id nA2LYXk7040991; Mon, 2 Nov 2009 15:34:33 -0600 (CST) (envelope-from dan) Date: Mon, 2 Nov 2009 15:34:33 -0600 From: Dan Nelson To: Chris Stankevitz Message-ID: <20091102213432.GY29215@dan.emsphone.com> References: <330157.31913.qm@web52911.mail.re2.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <330157.31913.qm@web52911.mail.re2.yahoo.com> X-OS: FreeBSD 7.2-STABLE User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: ClamAV version 0.94.1, clamav-milter version 0.94.1 on email1.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (email1.allantgroup.com [199.67.51.78]); Mon, 02 Nov 2009 15:34:33 -0600 (CST) X-Scanned-By: MIMEDefang 2.45 Cc: "freebsd-questions@freebsd.org" Subject: Re: please help me make sense of top's CPU output X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Nov 2009 21:34:37 -0000 In the last episode (Nov 02), Chris Stankevitz said: > I recently performed a CPU intensive task with Xorg. When I completed the > task and Xorg no longer was using the CPU, I got this result from top: > > === > > last pid: 1201; load averages: 0.24, 0.10, 0.09 up 0+00:29:42 > 63 processes: 1 running, 62 sleeping > CPU: 1.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 99.0% idle > Mem: 161M Active, 67M Inact, 68M Wired, 1240K Cache, 41M Buf, 1676M Free > Swap: 4060M Total, 4060M Free > > PID USERNAME THR PRI NICE SIZE RES STATE C TIME CPU > 1017 cstankevitz 1 104 0 366M 331M select 0 3:25 35.89% Xorg The CPU column in the process list is a decaying average (more useful to the kernel scheduler than an instantaneous value). You'll see it slowly drop to 0 over 10-15 seconds. Junior Hacker Project: add an instantaneous-CPU value (calculated by subtracting successive ki_runtime values) to the list of things top calculates and toggle it and weighted-CPU when pressing C. The toggling code is already there; it just toggles between two different weighted-cpu values at the moment. -- Dan Nelson dnelson@allantgroup.com