Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Oct 2008 11:58:05 +0200
From:      "Stefan Ehmann" <shoesoft@gmx.net>
To:        "FreeBSD gnats submit" <FreeBSD-gnats-submit@FreeBSD.org>
Subject:   bin/128177: wrong CPU usage reported by top/ps with SCHED_ULE
Message-ID:  <1224237485.22763@taxman.pepperland>
Resent-Message-ID: <200810171230.m9HCU5UT096010@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1224237485.22763>