-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Kernel: Improve single thread (CONFIG_MULTITHREADING=n) support #34279
Kernel: Improve single thread (CONFIG_MULTITHREADING=n) support #34279
Conversation
b6797e8
to
f4748cb
Compare
8301cee
to
56328ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that it fits much with Zephyr's overall market direction (increasingly moving into larger and more complicated systems), but it's nice to see this being resurrected. Any data on binary size to share?
Thank you @andyross. I do not want to reopen the discussion about the usefulness of the feature but suffice to say that the fact that we are investing time and effort into it, that we commit to maintaining it, that the ARC architecture might use it in the future and that it was useful for the Aarch64 maintainers when initially bringing up the platform should be enough reason to keep it. |
There will always be room for tiny microcontrollers anyway.
If Zephyr loses its ability to be trimmed down then people will write
another RTOS all over again.
|
This is good news. I can still use single-threaded + my own single-threaded thing-driven framework to develop simple applications. At the same time, I can also use the zephyr software ecosystem. |
56328ad
to
17b67ab
Compare
@andyross regarding:
Savings are not stunning (~2k) but it depends on the perspective. If you want to fit your bootloader in 4k pages. Then such savings may mean 4k vs 8k and that becomes significant. |
17b67ab
to
50e1958
Compare
56ce748
to
0d24343
Compare
…case Extended test to validate that timer API is working as expected when CONFIG_MULTITHREADING=n. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Extended test to validate following functionality: - k_busy_wait - k_timer - irq_lock/irq_unlock - k_cpu_idle - SYS_INIT() Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Extended mslab_api test suite with CONFIG_MULTITHREADING=n configuration. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Extended mheap_api_concept test suite to support case when multithreading is disabled. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This reverts commit 28cb9da.
This provides the documentation of scope required as a stage towards removing deprecation for CONFIG_MULTITHREADING=n. The specific lists of what does work will follow as the code base is inspected and updated. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no> Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Spin lock validation is touching threads. Allow only when multithreading is enabled. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Add support to no multithreading configuration. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Don use k_sleep when multithreading is disabled. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Fixed to ensure that semaphore is not used by the log core when multithreading is disabled. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Enable by default power managment only when multithreading is enabled. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Added test which verifies that when multithreading is disabled exception as correctly handled by the kernel. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Update configuration of qemu_cortex_m0 to use LF XTAL as low frequency clock source. Previously used RC requires more modules to be fetched into the build, including TEMP sensor used for clock calibration. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Removed #ifdef that guarded irq_offload API. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
537b679
to
0519100
Compare
@carlescufi rebased, CI green except for compliance failure that we need to live with. |
Sine zephyr zephyrproject-rtos/zephyr#34279 was merged there is no silent idle thread created automatically while CONFIG_MULTITHREADING=n. Since that any single thread application needs to call k_cpu_idle() by itself for entering idle mode, which allows for reduction power consumption. Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Sine zephyr zephyrproject-rtos/zephyr#34279 was merged there is no silent idle thread created automatically while CONFIG_MULTITHREADING=n. Since that any single thread application needs to call k_cpu_idle() (wrapped by MCUBOOT_CPU_IDLE_WFE) by itself for entering idle mode, which allows for reduction power consumption. Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Sine zephyr zephyrproject-rtos/zephyr#34279 was merged there is no silent idle thread created automatically while CONFIG_MULTITHREADING=n. Since that any single thread application needs to call k_cpu_idle() (wrapped by MCUBOOT_CPU_IDLE_WFE) by itself for entering idle mode, which allows for reduction power consumption. Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Sine zephyr zephyrproject-rtos/zephyr#34279 was merged there is no silent idle thread created automatically while CONFIG_MULTITHREADING=n. Since that any single thread application needs to call k_cpu_idle() (wrapped by MCUBOOT_CPU_IDLE_WFE) by itself for entering idle mode, which allows for reduction power consumption. Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Sine zephyr zephyrproject-rtos/zephyr#34279 was merged there is no silent idle thread created automatically while CONFIG_MULTITHREADING=n. Since that any single thread application needs to call k_cpu_idle() (wrapped by MCUBOOT_CPU_IDLE_WFE) by itself for entering idle mode, which allows for reduction power consumption. Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Sine zephyr zephyrproject-rtos/zephyr#34279 was merged there is no silent idle thread created automatically while CONFIG_MULTITHREADING=n. Since that any single thread application needs to call k_cpu_idle() (wrapped by MCUBOOT_CPU_IDLE) by itself for entering idle mode, which allows for reduction power consumption. Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Sine zephyr zephyrproject-rtos/zephyr#34279 was merged there is no silent idle thread created automatically while CONFIG_MULTITHREADING=n. Since that any single thread application needs to call k_cpu_idle() (wrapped by MCUBOOT_CPU_IDLE) by itself for entering idle mode, which allows for reduction power consumption. Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Sine zephyr zephyrproject-rtos/zephyr#34279 was merged there is no silent idle thread created automatically while CONFIG_MULTITHREADING=n. Since that any single thread application needs to call k_cpu_idle() (wrapped by MCUBOOT_CPU_IDLE) by itself for entering idle mode, which allows for reduction power consumption. Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Sine zephyr zephyrproject-rtos/zephyr#34279 was merged there is no silent idle thread created automatically while CONFIG_MULTITHREADING=n. Since that any single thread application needs to call k_cpu_idle() (wrapped by MCUBOOT_CPU_IDLE) by itself for entering idle mode, which allows for reduction power consumption. Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Sine zephyr zephyrproject-rtos/zephyr#34279 was merged there is no silent idle thread created automatically while CONFIG_MULTITHREADING=n. Since that any single thread application needs to call k_cpu_idle() (wrapped by MCUBOOT_CPU_IDLE) by itself for entering idle mode, which allows for reduction power consumption. Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
An attempt to improve no multithreading (no-mt) support in order to keep it in the tree by:
k_timer
is expected to work in no-mttests/kernel/timer/timer_api
to validate no-mt casek_busy_wait
,k_timer
,irq_locking
,k_cpu_idle
,SYS_INIT
z_arm_pendsv
from vector tableNote that currently all existing multithreading tests are passing only on
cortex_m
but having test coverage for expected scope will help to add support for other platforms.Separate PR will cover documentation (will be based on #29338).