I am emptying out a hard drive on some Linux 4.x OS using this command:
sudo sh -c 'pv -pterb /dev/zero > /dev/sda'
And I opened another tty and started sudo htop and noticed this:
PID USER PRI NI CPU% RES SHR IO_RBYTES IO_WBYTES S TIME+ Command
4598 root 20 0 15.5 1820 1596 4096 17223823 D 1:14.11 pv -pterb /dev/zero
The value for IO_WBYTES seems quite normal, but IO_RBYTES remains at 4 KiB and never changes.
I ran a few other programs, for example
dd if=/dev/zero of=/dev/zero
cat /dev/zero > /dev/zero
and was surprised to see none of them generates a lot of IO_RBYTES or IO_WBYTES.
I think this is not specific to any program, but why don't reads from /dev/zero and writes to /dev/{zero,null} count as I/O bytes?