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

cpuload: Fix wrong idle thread load #646

Merged
merged 1 commit into from
Feb 23, 2024
Merged

cpuload: Fix wrong idle thread load #646

merged 1 commit into from
Feb 23, 2024

Conversation

jlaitine
Copy link

This is a cherry-pick from upstream px4, fixing https://ssrc.atlassian.net/browse/DP-8252


When the CPU load monitor is started while already running, then the idle thread last_times[0] is reset to the last 1 second, rather than since when the CPU load monitor was last started. The remaining threads are not impacted, since their last_times[i] is reset to zero here.

This results in the idle thread having a lower than real CPU load, with the remaining CPU time being wrongly attributed as scheduler load.

When the CPU load monitor is started while already running, then the
idle thread last_times[0] is reset to the last 1 second, rather than
since when the CPU load monitor was last started. The remaining threads
are not impacted, since their last_times[i] is reset to zero here.

This results in the idle thread having a lower than real CPU load, with
the remaining CPU time being wrongly attributed as scheduler load.
@jlaitine jlaitine merged commit 7ff693f into main Feb 23, 2024
24 of 25 checks passed
@jlaitine jlaitine deleted the fix_px4_top_idle_load branch February 23, 2024 13:51
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.

3 participants