-
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
Update xTaskGetIdleTaskHandle() For SMP #868
Update xTaskGetIdleTaskHandle() For SMP #868
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #868 +/- ##
==========================================
+ Coverage 93.64% 93.77% +0.12%
==========================================
Files 6 6
Lines 3179 3179
Branches 885 885
==========================================
+ Hits 2977 2981 +4
+ Misses 95 91 -4
Partials 107 107
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thanks @Dazza0 for the PR. This needs a Backward compatibility decision making, which is best taken by feature owners. I have updated the feature owners and they are having a look at it. |
Bring back the requirement for more discussion.
Thank you for creating this PR and pointing out some of the API compatible problems. We would like to consider the following requirements:
In this PR, I would like create a PR to your branch to share my suggestion with |
The PR is created. Dazza0#1 |
@chinglee-iot Thanks for the review.
Just to double check that I understand the current requirements, does the following table accurately describe what the single-core vs SMP API usage policy will be for FreeRTOS going forward?
|
This commit updates xTaskGetIdleTaskHandle() for SMP in the following ways: - xTaskGetIdleTaskHandle() no longer accepts xCoreID argument in SMP so that there is not change in API between single-core and SMP - xTaskGetIdleTaskHandle() now returns the Active idle task handle in SMP, which matches the behavior in single-core. - Added xTaskGetIdleTaskHandleForCore() in SMP which accepts an xCoreID argument. This function can be used to obtain the Passive idle task handles.
a03fe67
to
b3bd665
Compare
@chinglee-iot I've merged Dazza0#1. Could you please verify if the table I posted accurately describes the SMP API requirements? |
Thank you for the table. It is correct and clear to me. |
Excuse me, I am confused about idle task and passive idle task. |
This is correct. Currently, the idle tasks don't have affinity on cores.
The implementation uses the xCoreID parameter as index. TaskHandle_t xTaskGetIdleTaskHandleForCore( BaseType_t xCoreID )
{
traceENTER_xTaskGetIdleTaskHandleForCore( xCoreID );
/* Ensure the core ID is valid. */
configASSERT( taskVALID_CORE_ID( xCoreID ) == pdTRUE );
/* If xTaskGetIdleTaskHandle() is called before the scheduler has been
* started, then xIdleTaskHandles will be NULL. */
configASSERT( ( xIdleTaskHandles[ xCoreID ] != NULL ) );
traceRETURN_xTaskGetIdleTaskHandleForCore( xIdleTaskHandles[ xCoreID ] );
return xIdleTaskHandles[ xCoreID ];
} Can you help to point out the line of code you mentioned? |
@Dazza0 |
Hi @chinglee-iot |
@Saiiijchan |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Description
Currently, when SMP is enabled (i.e.,
configNUMBER_OF_CORES > 1
), thexTaskGetIdleTaskHandle()
function has a change in API by accepting an extraxCoreID
function. Ideally, if SMP supports all single-core API, all existing single-core applications/libraries can be built for SMP without any modification (the kernel will just parallelize things across multiple cores transparently).This PR updates xTaskGetIdleTaskHandle() for SMP in the following ways:
xCoreID
argument in SMP so that it has the exact same API with single-core.Notes:
vApplicationGetIdleTaskMemory()
)xTaskCreateAffinitySet()
in single-core just results an a wrapping call toxTaskCreate()
with theuxCoreAffinityMask
argument being dropped. This will prevent applications needing to add numerous preprocessor checks ofconfigNUMBER_OF_CORES
and allow them to be written in a "core-agnostic" manner.Test Steps
Checklist:
Related Issue
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.