[Pkg-xfce-devel] Bug#664208: xfce4-cpugraph-plugin: System load graph shows 100% load on unloaded cores, but cores are actually idle

RandomCore debian at erben.com
Fri Mar 16 16:52:42 UTC 2012


Package: xfce4-cpugraph-plugin
Version: 1.0.1-2
Severity: normal
Tags: upstream

Dear Maintainer,

I have xfce4-cpugraph-plugin configured to show a graph for ALL cores
(I'm currently running a 6 core AMD CPU). On the idle system the graph
shows a usage of nearly 100%, as the tooltip on the graph area says as well.

If I chose a single core to display in the graph all seems well, but
switching back to "ALL" the graph gets "loaded" again.

I had a peak in the source and found that the plugin uses the values
from /proc/stat beginning with "cpu" to calculate the usage. After
86days of uptime those values for "cpu" (the summary for all cores) get
quite large:

------CUT------
# cat /proc/stat
cpu  69142289 4481985 46463581 4342043951 11291324 31445 873288 0 268929 0
cpu0 18724487 749359 20399968 703944470 1821744 0 35392 0 43545 0
cpu1 16300038 768942 7712109 718527326 2313696 0 58316 0 55763 0
cpu2 9349518 735007 2562932 731107820 1894374 2 60586 0 57471 0
cpu3 5995803 742693 2093307 734958181 1914908 24 18773 0 49460 0
cpu4 5015592 712153 1625294 737134417 1187895 415 67749 0 33366 0
cpu5 13756849 773828 12069968 716371735 2158705 31001 632469 0 29321 0
intr 7326358500 3664851343 10725376 0 0 4 0 0 1 0 2 0 0 0 0 0 0 73332665 24150490 267630200 146 416608742 114341064 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 131377555 98607359 103428341 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 !
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
ctxt 10337940883
btime 1324456956
processes 9513146
procs_running 2
procs_blocked 0
softirq 8903230587 0 1052949062 14175727 239913213 139296464 0 9989661 844769443 6050983 2301118738
------CUT------

I would guess, that the values are just too large to do the calculation
right anymore.

// ...
if( sscanf( cpuStr, "%*s %lu %lu %lu %lu %lu %lu %lu", &user, &nice, &system, &idle, &iowait, &irq, &softirq ) < 7 )
        iowait = irq = softirq = 0;
used = user + nice + system + irq + softirq;
total = used + idle + iowait;
if( (total - data[line].previous_total) != 0 )
{
        data[line].load = CPU_SCALE * (used - data[line].previous_used) /
                              (total - data[line].previous_total);
} //...

iIf I try this with the values above:

used = 69142289+4481985+46463581+31445+873288 = 120992588 (or 0x736334C)
total = used + 4342043951+11291324 = 179360567 (or 0xAB0D337)

If we assume user changed by 100 from the previous values

  load = 256*(120992588-120992488/(179360567-179360467)) =  30664361758 (or 0x723BD071E)
  
which is more than 64bit can hold.

And then, I may be wrong, because I actually just peaked into the
source and don't understand it at all..

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (x86_64)

Kernel: Linux 3.1.5-vs2.3.2.5 (SMP w/6 CPU cores; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages xfce4-cpugraph-plugin depends on:
ii  libc6               2.13-26
ii  libcairo2           1.10.2-6
ii  libgdk-pixbuf2.0-0  2.24.0-1
ii  libglib2.0-0        2.30.2-4
ii  libgtk2.0-0         2.24.10-1
ii  libxfce4util4       4.8.2-1
ii  libxfcegui4-4       4.8.1-4
ii  xfce4-panel         4.8.5-1

xfce4-cpugraph-plugin recommends no packages.

xfce4-cpugraph-plugin suggests no packages.

-- no debconf information





More information about the Pkg-xfce-devel mailing list