From owner-freebsd-current@FreeBSD.ORG Sun Mar 14 13:31:40 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 24D0016A4CE for ; Sun, 14 Mar 2004 13:31:40 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id D460843D31 for ; Sun, 14 Mar 2004 13:31:39 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.10/8.12.10) id i2ELVcQF032966; Sun, 14 Mar 2004 15:31:38 -0600 (CST) (envelope-from dan) Date: Sun, 14 Mar 2004 15:31:38 -0600 From: Dan Nelson To: Artem Ignatiev Message-ID: <20040314213136.GA27939@dan.emsphone.com> References: <1079276960.918.14.camel@timon.nist> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1079276960.918.14.camel@timon.nist> X-OS: FreeBSD 5.2-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: freebsd-current@freebsd.org Subject: Re: broken top stats X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Mar 2004 21:31:40 -0000 In the last episode (Mar 14), Artem Ignatiev said: > options SCHED_ULE > (cvsupped just before rebuilding kernel & world) > > top gives weird CPU/WCPU usage: only first (rarely, first couple) of > processes displayed have non-zero CPU/WCPU usage, all others have > zero cpu usage, but totals, shown in second line of top output > differs from sum of values in CPU column alot. Same with ps. E.g.: > > 51 processes: 2 running, 49 sleeping > CPU: 20.2% user, 0.0% nice, 3.5% system, 2.3% interrupt, 74.0% idle > Mem: 168M Active, 141M Inact, 98M Wired, 716K Cache, 60M Buf, 91M Free > Swap: 231M Total, 231M Free > > PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU CMD > 1363 timon 77 0 49544K 42140K RUN 1:11 6.25% 6.25% mozill > 890 timon 77 0 100M 83152K select 1:21 3.12% 3.12% XFree8 > 1344 timon 20 0 16184K 13144K kserel 1:55 0.00% 0.00% xmms > 918 timon 20 0 78616K 50344K kserel 0:44 0.00% 0.00% evolut > 901 timon 76 0 5556K 2604K select 0:25 0.00% 0.00% wmusic > 919 timon 20 0 41304K 37836K kserel 0:21 0.00% 0.00% pan There is a bug in the kernel threads code that does not total up all the kthread's CPU stats when a program asks for just process stats. It just pulls the first one. If you hit 'H', you should see some extra threads for each of those 0-cpu processes, and they should have non-zero CPU. Also, SCHED_ULE doesn't update WCPU at all (it just copies CPU). -- Dan Nelson dnelson@allantgroup.com