btop icon indicating copy to clipboard operation
btop copied to clipboard

Disk IO values shown on all disks

Open alfredjophy opened this issue 2 years ago • 6 comments

Description

Under heavy disk IO, like copying large files, the IO values are shown on all disks simultaneosuly

To Reproduce

Copy large files from one drive to another

Expected behavior Only IO values should be displayed over the two disks involved

Screenshots 2022-04-24T23:00:35,889723268+05:30

Info (please complete the following information):

  • btop++ version: 1.2.6
  • Binary: static binary from arch community
  • Architecture: x86_64
  • Platform: Linux
  • (Linux) Kernel: 5.17.4-zen1-1.1-zen
  • Terminal used: Kitty
  • Font used: Fira Code

alfredjophy avatar Apr 25 '22 01:04 alfredjophy

@AlfredEVOL Are there more than 1 physical disks involved or just multiple partitions on 1 disk? Because the IO stats will be for the whole disk not individual partitions.

aristocratos avatar Apr 26 '22 10:04 aristocratos

a single disk with multiple partitions

alfredjophy avatar Apr 26 '22 11:04 alfredjophy

@AlfredEVOL Took a look at the code again and the structure of /sys/block and noticed that stats for individual partitions should be doable.

Try with latest commit, binaries.

aristocratos avatar Apr 26 '22 18:04 aristocratos

well, I had to reinstall my OS and went with a LVM setup The repo version on showed a single LVM partiiton and the the binary from the latest commit shows each one. The disk IO seems right as these are just logical volumes on single btrfs partition.

~ 
❯ lsblk
NAME          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
zram0         253:0    0   7.2G  0 disk  [SWAP]
nvme0n1       259:0    0 476.9G  0 disk  
├─nvme0n1p1   259:1    0   512M  0 part  /boot
└─nvme0n1p2   259:2    0 476.4G  0 part  
  └─cryptroot 254:0    0 476.4G  0 crypt /var/log
                                         /var/cache/pacman/pkg
                                         /srv
                                         /root
                                         /home
                                         /.snapshots
                                         /

2022-04-27T10:59:33,688248581+05:30

Im unable to test for physical partitions for now

alfredjophy avatar Apr 27 '22 05:04 alfredjophy

Because the IO stats will be for the whole disk not individual partitions.

This isn't clear at all... and also doesn't seem correct... On my system boot (a separate partition) seems to always get IO activity counted on it incorrectly, when the real activity is either on root or home.... root and home seem to track activity independently (and correctly). boot is the only partition I have that seems to be counting wrong.

These are all the same physical disk, but different parttiions, LLVM, etc... rougly:

$ lsblk
NAME              MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda                 8:0    0 465.8G  0 disk
├─sda1              8:1    0   512M  0 part  /boot
├─sda2              8:2    0   110G  0 part
├─sda3              8:3    0   125G  0 part
│ ├─vg0-cryptroot 254:0    0    30G  0 lvm
│ │ └─root        254:5    0    30G  0 crypt /
│ ├─vg0-crypthome 254:3    0    30G  0 lvm
│ │ └─home        254:8    0    30G  0 crypt /home

joshgoebel avatar May 21 '22 13:05 joshgoebel

@joshgoebel That's likely because your root and home dev paths is wrapped by encryption. The partition stats and the IO stats are collected from different kernel functions and it's basically guesswork on my part to try to match IO stats to a particular partition. The IO stats gets a list of names and matching is done by getting the absolute path of the partition dev path, stripping everything but the filename and then removing the last letter until it matches or the name is shorter than 2 letters in which case it fails.

But some progress has been made recently as referenced above. Do you see any difference if you build from git source (or use the binaries linked above)?

aristocratos avatar May 21 '22 13:05 aristocratos