-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
load_mon: increase cpuload update rate, get corresponding time safetly, and misc cleanup #15342
Conversation
dagar
commented
Jul 15, 2020
- increase rate from 1 Hz to 3.3 Hz (every 300 ms)
- cpu load calculation grab timestamp with runtime in a critical section
- task stack only check one task per cycle (but cycle at a higher rate)
- decrease available FD threshold 3 -> 2
- minor cleanup (split out header)
1a018c9
to
5b53633
Compare
- increase rate - cpu load calculation grab timestamp atomically - only check one task per cycle (but cycle at a higher rate) - decrease available FD threshold - minor cleanup
cd2fd59
to
cb366dc
Compare
I increased the rate slightly because I wanted to have a bit more detail in the logs. |
|
||
// Found task low on file descriptors, report and exit. Continue here in next cycle. | ||
if (fds_free < FDS_LOW_WARNING_THRESHOLD) { | ||
PX4_WARN("%s low on FDs! (%i FDs left)", task_stack_info.task_name, fds_free); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These warnings will now appear 3 times per second and spam the log quite a bit, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These warnings will now appear 3 times per second and spam the log quite a bit, right?
Only in the worst case if running the max number of tasks (32 or 64) and every one of them was either low on stack or FDs.
Overall it's kind of a lateral move. Currently in master it cycles at 1 Hz, but each iteration checks 2 tasks, and if a task entry (an array of CONFIG_MAX_TASKS) is empty it jumps forward. Now it runs slightly faster for the sake of cpuload measurement, but it's doing less work per iteration checking tasks.