Bug 68158 - top showing incorrect CPU usage
top showing incorrect CPU usage
Status: CLOSED NOTABUG
Product: Red Hat Public Beta
Classification: Retired
Component: procps (Show other bugs)
limbo
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Alexander Larsson
Brian Brock
http://gateway.dehaan.dhs.org/~dan/Sc...
:
Depends On:
Blocks: 67218
  Show dependency treegraph
 
Reported: 2002-07-07 02:40 EDT by Dan de Haan
Modified: 2007-04-18 12:43 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-07-08 12:22:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dan de Haan 2002-07-07 02:40:30 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020625

Description of problem:
While compiling wine in one gome-terminal and listeding to MP3's with XMMS. I
ran top in another gnome-terminal.

In the top of TOP it shows high CPU usage, but all the running processes do not
add up to using anywhere near the show CPU usage.

The URL provided goes to a screenshot showing this.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
In this case, compile wine and run XMMS and a few other apps, then run top.
Comment 1 Nathan G. Grennan 2002-07-07 18:30:23 EDT
Your screenshot doesn't appear to have top sorted by CPU, so it is hard to tell.
At least glance it appears CPU sorted, but you have 0.0 cpu stuff before 0.1 cpu
stuff. Can you include a CPU sorted top and a longer list?
Comment 2 Alexander Larsson 2002-07-08 11:04:49 EDT
In the screenshot it looks like it's in the middle of updating the display, so
that is why it's not looking sorted.

Collecting these kinds of data are kind of racy though. Data is read from
several sources, and the state could change between reading the global stats and
the process list data. I'll take a look at what could be happening.
Comment 3 Dan de Haan 2002-07-08 12:22:27 EDT
Right, the screenshot was while it was being updated.  The list was definatley
being sorted by CPU usage.

I watched top for about 10 mintures trying to figure out where all the CPU was
going to.

I will recreate this later in the day, and try to get a better screenshot.
Comment 4 Alexander Larsson 2002-07-09 11:17:24 EDT
I know what's happening. You're compiling while running top, and the compilation
starts several shortlived processes that use lots of cpu. These all show up in
the CPU status field, because it looks at how many system-wide ticks were used up.

The stuff in the list only shows the currently running processes though, and if
the top refresh rate is long, a lot of processes that used time in between the
updates have died. Say everyone but the last compilation finished, and the last
compilation only has run for 1 second. The calculated %CPU for that compilation
is then 1/5 == 20% (5 sec is the default delay). The rest of the CPU using
processes are not in the list, because they already died.


Note You need to log in before you can comment on or make changes to this bug.