-
Notifications
You must be signed in to change notification settings - Fork 7.3k
tests: arm thread swap: increase Idle Stack size for no-opt test-case #19318
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
tests: arm thread swap: increase Idle Stack size for no-opt test-case #19318
Conversation
Here's the log on nRF52811_pca10056:
|
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.
Ugh. OK, so this works for the test. What about applications that might select that option, or future use in other tests?
One path would be to make it like KOBJECT_TEXT_AREA
and have a conditional default in Kconfig. But since there are already five different defaults, doing that would be messy. It'd also be ignored for the boards that override the default in defconfig.
Another path is to modify kernel/init.c to conditionally add an architecture-specific increment at the point the local IDLE_STACK_SIZE
is defined, if CONFIG_NO_OPTIMIZATIONS
has been selected. That seems a little more robust.
I'm not loving either of those, but the second does have some appeal if there's any reasonable argument that somebody might select CONFIG_NO_OPTIMIZATIONS
outside of this test (or coverage, which probably can't be run on real target hardware).
Thoughts?
Executing the ARM thread swap test with NO_OPTIMIZATIONS option set, leads to Idle thread stack overflow in certain platforms. We increase the size of the Idle thread stack to address this. Signed-off-by: Ioannis Glaropoulos <[email protected]>
679130c
to
0cb307e
Compare
Thanks for looking at this @pabigot !
Right. So currently, arm_thread_swap is the only (?) test that runs a test-case with NO_OPTIMIZATIONS. So that's why I didn't promote, initially, a more generic solution.
This could be a solution, yes.
because, some of the conditionals are ARCHEs, and some are not (e.g. COVERAGE_GCOV)
This would require an investigation of what the extra space would be for each ARCH. |
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.
Ugh. OK, so this works for the test. What about applications that might select that option, or future use in other tests?
Right. So currently, arm_thread_swap is the only (?) test that runs a test-case with NO_OPTIMIZATIONS. So that's why I didn't promote, initially, a more generic solution.
I'm less concerned with other tests than I am with users who choose to enable that option in order to do debugging/diagnostics for problems obscured by optimization. Being blocked by the fact that a swap then corrupts stack would add a big distractor to the task.
Another path is to modify kernel/init.c to conditionally add an architecture-specific increment at the point the local IDLE_STACK_SIZE is defined, if CONFIG_NO_OPTIMIZATIONS has been selected. That seems a little more robust.
This would require an investigation of what the extra space would be for each ARCH.
But: isn't this similar to re-defining the IDLE_STACK_SIZE Kconfig option in the ARCH Kconfigs? (So we can avoid touching C code)
Yes, but in Kconfig we'd have to do a per-architecture approach. We could simply assume that adding 256 or 320 to the architecture-specific offset in init.c is enough, until we have reason to believe it isn't.
I don't have strong feelings about this, so I'm gonna go ahead and approve it as is. If/when we run into the same problem again we should make a more serious effort to find a general solution.
For me, CONFIG_NO_OPTIMIZATIONS is something the developer will set if they really know what they are doing. And they should accept that this may require re-adjusting the core thread stacks (main, idle, ztest, etc.) but i think I agree with your last comment, @pabigot - let's fix this for this sole test, now, and if we see in the near future that we run into similar problems, we can standardize the solution. |
Executing the ARM thread swap test with NO_OPTIMIZATIONS
option set, leads to Idle thread stack overflow in certain
platforms. We increase the size of the Idle thread stack to
address this.
Signed-off-by: Ioannis Glaropoulos [email protected]