-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 optimisations to xTaskIncrementTick(). #241
Minor optimisations to xTaskIncrementTick(). #241
Conversation
…in xTaskIncrementTick(). This provides a minor optimisation to remove the need for a few function calls.
/bot run checks |
2 similar comments
/bot run checks |
/bot run checks |
Codecov Report
@@ Coverage Diff @@
## main #241 +/- ##
=======================================
Coverage 90.60% 90.60%
=======================================
Files 3 3
Lines 532 532
Branches 142 142
=======================================
Hits 482 482
Misses 14 14
Partials 36 36
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
Description
Create macro versions of uxListRemove() and vListInsertEnd() for use in xTaskIncrementTick(). This provides a minor optimisation to remove the need for a few function calls.
Cycle counts for executing xTaskIncrementTick() on a Cortex-M where the increase in the tick value results in one task being moved from the Blocked list:
Original code: 212
After inlining uxListRemove: 207
After inlining vListInsertEnd: 192
Writing a Cortex-M specific handler in assembly that only calls C code if a task needs to be removed from the blocked list takes the cycle count down to 185. Not sure if saving 7 cycles makes that worthwhile so I've not cleaned it up to check in. However it is probably worth while for the tick interrupts that do not result in a task being removed from the blocked state as the cycle count can be brought below 30 (I think).
Test Steps
Full integration test project running on a Cortex-A9 with GCC and full optimisation. Required a memory barrier, so needs more testing. Suggest running the full tests in QEMU with GCC, IAR and ARM compilers at full optimisation.