Menu

#272 ${diskio} reports twice value of actual.

closed-fixed
nobody
None
5
2010-02-03
2010-01-29
ichelm
No

I am using conky-1.7.2 with linux-2.6.31-gentoo-r6 on my gentoo box.

Using ${diskio} without argument, it shows twice value of actual value. (See screenshot)

I think that counting total_reads/total_writes (in update_diskio, src/linux.c) is incorrect.
It seems to an entire disk(eg sda) value and each individual partition(eg sda1,sda2,...) value are added to total_reads/total_writes.
But already entire disk value is the sum of each partition.
As a result, I/O values are counted twice.

I am sorry for my lack of coding skill. Regards.

Discussion

  • ichelm

    ichelm - 2010-01-29

    screenshot

     
  • Cesare Tirabassi

    Can you post the output of "cat /proc/diskstats"?
    Also consider that diskio will report ALL disk read/writes, so if you have another disk (say sdb) this will get added to sda to get to the total.

     
  • ichelm

    ichelm - 2010-01-29

    screenshot 2

     
  • ichelm

    ichelm - 2010-01-29

    /proc/diskstats

     
  • ichelm

    ichelm - 2010-01-29

    I atached /proc/diskstats and new screenshot. There are two HDDs on my box.
    Please see screenshot2, ${diskio} reports twice value of I/O.

     
  • Cesare Tirabassi

    Looks like the proc diskio interface changed for 2.6.31 and so the awful hack that was used to distinguish between a disk and its partitions doesn't work anymore.

     
  • Nobody/Anonymous

    I just commited a patch for this in the 1.8.0 branch. Before committing to master I would however like you to check it out.
    Could you do that?

     
  • ichelm

    ichelm - 2010-01-31

    src/linux.c patch

     
  • ichelm

    ichelm - 2010-01-31

    patched Conky screenshot

     
  • ichelm

    ichelm - 2010-01-31

    Conky with patch from git tree.

     
  • ichelm

    ichelm - 2010-01-31

    Thanks to norsett for your suggestion.
    I found a similar case at procps.
    See https://bugzilla.redhat.com/show_bug.cgi?id=485243

    I simply copied procps's patch to conky-1.7.2/src/linux.c.
    And it seems to that works fine. (See screenshot-mypatch)

    Also I saw patch on git. But probably it works incorrect for many devices (eg /dev/sr0).
    See screenshot-gitpatch, sr0(SATA CD-ROM) I/O has not been counted.

     
  • Nobody/Anonymous

    >Also I saw patch on git. But probably it works incorrect for many devices (eg /dev/sr0).

    Well, when we discussed the patch we considered this a feature, not a bug ...

     
  • Cesare Tirabassi

    Thanks, I uploaded your patch.

     
  • ichelm

    ichelm - 2010-02-01

    I applied your new patch (from git) to my conky-1.7.2 ,
    Now I can continue happy Conkying with this patch ;)

    I think this issue should be Closed/Fixed.
    Thank you very much.

     
  • ichelm

    ichelm - 2010-02-03
    • status: open --> closed-fixed
     

Log in to post a comment.