FreeRTOS / FreeRTOS-Kernel

FreeRTOS kernel files only, submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos.
https://www.FreeRTOS.org
MIT License
2.52k stars 1.05k forks source link

[Feature Request] Default Affinity Set #993

Closed go2sh closed 5 months ago

go2sh commented 5 months ago

Is your feature request related to a problem? Please describe. We created a freeRTOS SMP port for the Infineon TC3x and TC4x family, but the system design is not really symmetrical. Especially the Task context ist bound to the CPU executing the task. This makes switching tasks between different CPUs nearly impossible. But the SMP design still makes some sense to distribute work across cores more easily. For example in conjunction with FreeRTOS-Plus-TCP to distribute sockets across cores.

Describe the solution you'd like Create a new config flag to allow setting a default affinity for a task, where no affinity set is provided during task creation. This is especially useful for legacy code. This could either be a fixed value or the current core, who creates the task.

Describe alternatives you've considered Non

How many devices will this feature impact? All TC3x and TC4x devices with SMP enabled.

What are your project timelines? A patch is already prepared internally.

go2sh commented 5 months ago

Would you accept a PR for this?

rawalexe commented 5 months ago

Hello thank you so much for reporting about this problem, we can definitely consider accepting the PR, Please feel free to go ahead and create your PR, the team can have look at it and share more details on it.