Bug 465768

Summary: iowait is counted as cpu usage by per-core sensors
Product: [Frameworks and Libraries] ksystemstats Reporter: Russell Haley <yumpusamongus+kde>
Component: GeneralAssignee: KSysGuard Developers <ksysguard-bugs>
Status: REPORTED ---    
Severity: normal CC: ahiemstra, plasma-bugs, yumpusamongus+kde
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=339164
https://bugs.kde.org/show_bug.cgi?id=238331
https://bugs.kde.org/show_bug.cgi?id=83143
https://bugs.kde.org/show_bug.cgi?id=120422
Latest Commit: Version Fixed In:
Attachments: script that reproduces the problem (and doesn't thrash the cache)
screenshot showing all 3 affected applications

Description Russell Haley 2023-02-15 13:45:04 UTC
Created attachment 156271 [details]
script that reproduces the problem (and doesn't thrash the cache)

SUMMARY

IO wait time is counted as CPU busy time by whichever underlying library is used plasma-systemmonitor, ksysguard, and desktop sensor widgets.

STEPS TO REPRODUCE
1. Open the "history" view of plasma-systemmonitor, or the "System Load" tab of ksysguard, or have a system monitor widget using the "Core # Total Usage" sensor on your panel.
2. Run the attached script.  If you don't have any SATA drives, change "/dev/sda" to something you do have.

OBSERVED RESULT

CPU usage appears to be 100%, even though the workload is totally I/O bound.

EXPECTED RESULT

CPU usage includes only % of time the CPU is executing instructions, matching the much lower value reported by htop.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma:  Fedora Linux 37
(available in About System)
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION

This has probably been reported before, as bug 339164 against the plasma4 widget.
Comment 1 Russell Haley 2023-02-15 13:48:58 UTC
Created attachment 156272 [details]
screenshot showing all 3 affected applications
Comment 2 Russell Haley 2023-02-15 14:03:36 UTC
Looks like I missed a few dupes.  Guess I'm the first to report this against plasma-systemmonitor, though =P