Linux: Correctly mark trailing offline CPU threads #1394
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
htop checks cpu IDs in /proc/stat, and marks any in-between IDs as missing.
This check was counting with leading offline threads(somewhat accidentally, as cpu0 is total in the code), but not trailing.
Left is 3.3.0, Right is 3.3.0 with this PR.
This supersedes #1342 which attempts to fix the same thing, but ignores thread IDs and just marks them active sequentially from 0.
It also fixes one of the two problems in #757 and the remaining issue is already tracked in #1198, so that can be closed after merge.
This was introduced in 41af31b#diff-7b4ee00635e2355bc3b83ada6e57991d2a79ba37828dab7128c461c14645580aR1865