From owner-freebsd-bugs@FreeBSD.ORG Fri Oct 17 12:30:05 2008 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 74BDA106568F for ; Fri, 17 Oct 2008 12:30:05 +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 3F4618FC1E for ; Fri, 17 Oct 2008 12:30:05 +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 m9HCU55q096013 for ; Fri, 17 Oct 2008 12:30:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id m9HCU5UT096010; Fri, 17 Oct 2008 12:30:05 GMT (envelope-from gnats) Resent-Date: Fri, 17 Oct 2008 12:30:05 GMT Resent-Message-Id: <200810171230.m9HCU5UT096010@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, "Stefan Ehmann" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D75311065690 for ; Fri, 17 Oct 2008 12:24:18 +0000 (UTC) (envelope-from shoesoft@gmx.net) Received: from mailbackup.inode.at (mailbackup.inode.at [213.229.60.24]) by mx1.freebsd.org (Postfix) with ESMTP id 93AE28FC0A for ; Fri, 17 Oct 2008 12:24:18 +0000 (UTC) (envelope-from shoesoft@gmx.net) Received: from [62.99.145.10] (port=15994 helo=mx.inode.at) by mailbackup.inode.at with esmtp (Exim 4.67) (envelope-from ) id 1Kqm5w-00040M-DD for FreeBSD-gnats-submit@freebsd.org; Fri, 17 Oct 2008 11:58:08 +0200 Received: from [85.127.86.101] (port=6856 helo=taxman.pepperland) by smartmx-10.inode.at with esmtp (Exim 4.50) id 1Kqm5t-00026v-FJ for FreeBSD-gnats-submit@freebsd.org; Fri, 17 Oct 2008 11:58:05 +0200 Message-Id: <1224237485.22763@taxman.pepperland> Date: Fri, 17 Oct 2008 11:58:05 +0200 From: "Stefan Ehmann" To: "FreeBSD gnats submit" X-Send-Pr-Version: gtk-send-pr 0.4.9 Cc: Subject: bin/128177: wrong CPU usage reported by top/ps with SCHED_ULE 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, 17 Oct 2008 12:30:05 -0000 >Number: 128177 >Category: bin >Synopsis: wrong CPU usage reported by top/ps with SCHED_ULE >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Oct 17 12:30:04 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Stefan Ehmann >Release: FreeBSD 7.1-PRERELEASE i386 >Organization: >Environment: System: FreeBSD 7.1-PRERELEASE #64: Fri Oct 17 11:04:45 CEST 2008 stefan@taxman.pepperland:/usr/obj/usr/src/sys/TAXMAN >Description: If a process runs in a busy loop, the CPU usage reported in top/ps is wrong. It starts at ~20% and goes down to 0% within a few seconds. The overall CPU usage is reported correctly. Here's the top output: last pid: 22916; load averages: 0.71, 0.48, 0.39 up 0+00:25:47 11:32:57 87 processes: 4 running, 83 sleeping CPU: 96.3% user, 0.0% nice, 3.4% system, 0.4% interrupt, 0.0% idle Mem: 261M Active, 110M Inact, 134M Wired, 1656K Cache, 110M Buf, 482M Free Swap: 1280M Total, 1280M Free PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND 22916 stefan 1 98 0 3500K 1684K RUN 0:02 11.18% sh <-- this should be ~100% 22719 stefan 1 44 0 103M 57444K RUN 1:10 0.00% Xorg Only happens with SCHED_ULE. With SCHED_4BSD the reported values look sane. I didn't see this on 8-CURRENT on the same machine when I've tested it about 2 weeks ago. >How-To-Repeat: Run a program that uses all available CPU cycles, e.g. $ while true; do true; done Look at CPU usage reported by top or ps. >Fix: >Release-Note: >Audit-Trail: >Unformatted: