Skip to content
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: Kconfig: increase test default MAIN_STACK_SIZE #31865

Merged
merged 1 commit into from
Feb 2, 2021

Conversation

ABOSTM
Copy link
Collaborator

@ABOSTM ABOSTM commented Feb 2, 2021

There are several reasons to increase MAIN_STACK_SIZE for test purpose:

  • activation of CONFIG_FPU_SHARING by default when CONFIG_FPU is enabled for ARM arch (see ARM: Make FPU Sharing the default mode and activate Lazy FP stacking dynamically #31772)
    This increase stack usage and requires MAIN_STACK_SIZE enlargement.

  • more and more tests failed due to stackoverflow.

    • tests/kernel/threads/tls/kernel.threads.tls.userspace
    • tests/kernel/fatal/exception/kernel.common.stack_protection_arm_fpu_sharing
    • tests/kernel/common/kernel.common.tls
    • tests/kernel/poll/

    And it concerns several boards: stm32f3_disco and nucleo_f746zg

Arbitrary increase from 512 to 768.
This fixes above issues.
No regression found on STM32 test bench.

@ABOSTM ABOSTM requested a review from andyross as a code owner February 2, 2021 10:33
@ABOSTM ABOSTM requested a review from ioannisg February 2, 2021 10:33
@ABOSTM ABOSTM requested a review from erwango February 2, 2021 10:33
Copy link
Member

@ioannisg ioannisg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed with the motive, not sure with the value and how to set it :) Left a comment.

kernel/Kconfig Outdated
@@ -150,7 +150,7 @@ config SCHED_CPU_MASK
config MAIN_STACK_SIZE
int "Size of stack for initialization and main thread"
default 2048 if COVERAGE_GCOV
default 512 if ZTEST && !(RISCV || X86)
default 768 if ZTEST && !(RISCV || X86)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls, make this 1024;

768 is not a power-of-2, and Cortex-M builds on ARMv7-M with Userspace will move to 1024 anyway... So putting 1024 will be less confusing.

Alternatively (since your primary target is ARM Cortex-M) you can add a new default line before line 153:

default 1024 if TEST_ARM_CORTEX_M

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you won't be changing the default setting for other ARCHes like Xtensa, Sparc, AARC64 and ARC

There are more and more tests that fail due to stackoverflow.
Increasing MAIN_STACK_SIZE to fix those issues.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
@ABOSTM ABOSTM force-pushed the INCREASE_MAIN_STACK_SIZE branch from b3c9d2c to 08ef875 Compare February 2, 2021 13:37
@ioannisg
Copy link
Member

ioannisg commented Feb 2, 2021

@nashif that's for v2-5-0 release, imho

@ioannisg ioannisg added area: ARM ARM (32-bit) Architecture bug The issue is a bug, or the PR is fixing a bug labels Feb 2, 2021
@nashif nashif merged commit 8925af9 into zephyrproject-rtos:master Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARM ARM (32-bit) Architecture area: Kernel bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants