Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu_usage/linux: count iowait toward idle time #2681

Merged
merged 1 commit into from
Nov 19, 2023

Conversation

tactikauan
Copy link
Contributor

The iowait time present in /proc/stat is a sub-category of idle, and therefore shouldn't count toward CPU usage. However, Waybar doesn't account for it when calculating the idle time, giving wrong results in some cases.

For example, when running the following command on an idle system, to create a completely I/O bound task pinned to the first CPU:

taskset 1 dd if=/dev/sda of=/dev/null bs=1MB

Waybar displays the first CPU at 100% usage, which is incorrect, since the CPU is idle most of the time waiting for I/O, while other tools such as htop display the same CPU fairly close to 0%.

@Alexays Alexays merged commit c299ea9 into Alexays:master Nov 19, 2023
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants