gopsutil icon indicating copy to clipboard operation
gopsutil copied to clipboard

In linux cpu iowait should be treated like idle time.

Open msays2000 opened this issue 5 years ago • 1 comments

https://github.com/shirou/gopsutil/blob/6d64cd6d43e7927e70891507b795c176a60caf37/cpu/cpu.go#L99

If iowait implies cpu is technically free to do any other ready work, then we should treat it as idle time.

In python psutil and in htop it is treated as idle time.

https://github.com/giampaolo/psutil/blob/550c825c95b537e9c3fee8452e5e1cd4fe5c704a/psutil/init.py#L1664-L1677

https://github.com/torvalds/linux/blob/447976ef4fd09b1be88b316d1a81553f1aa7cd07/kernel/sched/cputime.c#L244-L253

msays2000 avatar Jul 10 '20 07:07 msays2000

PR treating iowait as idle time: https://github.com/shirou/gopsutil/pull/903

msays2000 avatar Jul 10 '20 08:07 msays2000