eclipse-threadx / threadx

Eclipse ThreadX is an advanced real-time operating system (RTOS) designed specifically for deeply embedded applications.
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/threadx/index.md
MIT License
2.82k stars 774 forks source link

Does threadx support dynamic power off one or more cores in SMP system? #262

Closed carll00226 closed 1 year ago

carll00226 commented 1 year ago

HI, all: We are using threadx in a SMP * 4 system and we want to power off 1 , 2 or 3 cores when necessary, what need to do for threadx? I find the macro TX_THREAD_SMP_DYNAMIC_CORE_MAX, but it seems threadx do not change the value of _tx_thread_smp_max_cores, so what is it used for ?

TiejunMS commented 1 year ago

For ThreadX, you will need to exclude the cores for every thread by tx_thread_smp_core_exclude(). And also exclude those cores for timer by tx_timer_smp_core_exclude().

carll00226 commented 1 year ago

Hi,TiejunMS: What's the meaning of "exclude those cores for timer by tx_thread_smp_core_get()"? tx_thread_smp_core_get just get the core id. Do you mean the tick timer? the core which start the tick timer will not be powered down until the cluster powered off.

carll00226 commented 1 year ago

core0 start the tick timer and decide which cores should be power down at a certain time. Whether the other cores must be idle when core0 exclude these cores for every thread and then power them down ? If core0 want to power down a core at any time, send a message to notify the core, and the core is executing a task at this time, how to save the context and exclude the task from this core ?

TiejunMS commented 1 year ago

Sorry about the typo. The API to exclude timer cores should be tx_timer_smp_core_exclude.

TiejunMS commented 1 year ago

Closing