#33 SMP CPU monitor counts I/O wait as CPU usage

minor
closed-fixed
Markus Dolze
5
2009-04-20
2009-02-08
Stephan Sokolow
No

When a program is spending most of its time waiting on the disk, other CPU monitors report CPU usage of roughly 15% per core while the lcdproc SMP CPU monitor reports that CPU1 (my second core) is wavering between 95% and 100%, roughly.

Discussion

  • Markus Dolze
    Markus Dolze
    2009-02-23

    Which system are you using? Please post the output of 'uname -a'.

     
  • Linux monolith 2.6.25-gentoo-r7 #5 SMP PREEMPT Wed Aug 20 07:21:19 EDT 2008 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 5000+ AuthenticAMD GNU/Linux

     
  • Markus Dolze
    Markus Dolze
    2009-03-08

    The lcdproc client uses information from /proc/stat. Looking at the code I can't find an obvious error. Could you supply an example of your /proc/stat, especially if the problem happens?

     
  • Here's a cat of /proc/stat while MVing a large movie from one drive to another. Aside from MV, the CPU was at 0% on the first core and wavering below 5% on the second.

    That single MV was enough to make the lcdproc monitor jump to wavering between 25% and 100% on the second core, despite being I/O-bound and not a significant CPU consumer according to other monitors.
    File Added: proc_stat3.txt

     
  • Result of a single file copy while the CPU was otherwise unoccupied

     
    Attachments
  • Markus Dolze
    Markus Dolze
    2009-03-09

    I spotted the problem: When retrieving the load values, the iowait time is ignored in the overall load value. Therefore the real CPU load is close to the overall load value resulting in a high load percentage.

    This affects not only SMP load screen, but normal CPU screen as well.

     
  • Markus Dolze
    Markus Dolze
    2009-03-09

    • assigned_to: nobody --> mmdolze
     
  • Markus Dolze
    Markus Dolze
    2009-03-09

    1st patch to address this issue

     
    Attachments
  • Does the attached patch fixes the problem for you?

     
  • My life has become VERY busy in the last little while. I'm not sure how long it'll be before I can test your patch. It'll be at least a week though.

     
  • Markus Dolze
    Markus Dolze
    2009-04-20

    Fix commited to CVS. Bug closed as 'fixed' after 4 weeks without response. Please reopen it if the problem persists.

     
  • Markus Dolze
    Markus Dolze
    2009-04-20

    • status: open --> closed-fixed