From dc7bd942d780a8783aa02a8c5d43224d219a0e1a Mon Sep 17 00:00:00 2001 From: Ian Thompson Date: Tue, 14 Jan 2025 19:37:00 -0800 Subject: [PATCH] SMP: Ensure idle tasks have affinity set to run only on their own core. Signed-off-by: Ian Thompson --- tasks.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tasks.c b/tasks.c index 24cfb2620..a3d585ed0 100644 --- a/tasks.c +++ b/tasks.c @@ -3676,6 +3676,9 @@ static BaseType_t prvCreateIdleTasks( void ) /* Assign idle task to each core before SMP scheduler is running. */ xIdleTaskHandles[ xCoreID ]->xTaskRunState = xCoreID; pxCurrentTCBs[ xCoreID ] = xIdleTaskHandles[ xCoreID ]; + #if ( configUSE_CORE_AFFINITY == 1 ) + vTaskCoreAffinitySet(xIdleTaskHandles[ xCoreID ], 1 << xCoreID); + #endif } #endif }