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

minor thread/task priority adjustments #15327

Closed
wants to merge 1 commit into from
Closed

Conversation

dagar
Copy link
Member

@dagar dagar commented Jul 14, 2020

The goal here is to ensure consistent scheduling of the IMUs, immune to things like parameter update. Initially with the PX4 work queue the rate control (inner loop) thread was the highest priority to ensure it runs immediately when the primary gyro publishes.

With nearly all the sensor processing removed from the bus thread (now handled downstream in sensors) the actual cpu time spent in a driver is minimal (~10-20us) and overall it's slightly faster to let them always run to completion and avoid additional high rate context switching.

So overall there is a small increase in control latency (and potential jitter), but I consider it negligible.

  • SPI threads become highest priority to ensure consistent scheduling
  • run inner loop after SPI (for primary IMU)
  • adjust remaining task priorities to be consistent with PX4 work queue

@dagar dagar force-pushed the pr-priorities_adjust branch from d98b1a5 to 50a8690 Compare July 14, 2020 14:46
 - SPI threads become highest priority to ensure consistent scheduling
 - run inner loop after SPI (for primary IMU)
 - adjust remaining task priorities to be consistent with PX4 work queue
 - replace magic priority levels with PX4 tasks defines wherever possible
@dagar dagar force-pushed the pr-priorities_adjust branch from 50a8690 to 1522e27 Compare July 15, 2020 13:57
@dagar dagar closed this Jul 23, 2020
@LorenzMeier LorenzMeier deleted the pr-priorities_adjust branch January 18, 2021 14:48
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.

1 participant