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

core/thread: always use THREAD_CREATE_STACKTEST when DEVELHELP is enabled #20450

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Mar 7, 2024

Contribution description

We already create every thread with THREAD_CREATE_STACKTEST.
If someone creates a thread without it, ps output is weird (all stack is marked as used) and the overhead is only at thread creation and only when DEVELHELP is set.

Remove the flag (but keep the define to not break apps) since in all those years, not a single use-case has been found for creating a thread without THREAD_CREATE_STACKTEST.

Testing procedure

ps still uses the stack usage with DEVELHELP=1, even when THREAD_CREATE_STACKTEST is not set:

2024-03-07 15:52:26,233 # > ps
2024-03-07 15:52:26,237 # 	pid | name                 | state    Q | pri | stack  ( used) ( free) | base addr  | current     
2024-03-07 15:52:26,238 # 	  - | isr_stack            | -        - |   - |   8192 (   -1) ( 8193) |  0x805f800 |  0x805f800
2024-03-07 15:52:26,238 # 	  1 | idle                 | pending  Q |  15 |   8192 (  436) ( 7756) |  0x8058100 |  0x8059f60 
2024-03-07 15:52:26,238 # 	  2 | main                 | running  Q |   7 |  12288 ( 2776) ( 9512) |  0x805a100 |  0x805cf60 
2024-03-07 15:52:26,239 # 	    | SUM                  |            |     |  28672 ( 3212) (25460)

Issues/PRs references

@github-actions github-actions bot added Area: network Area: Networking Area: tests Area: tests and testing framework Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: pkg Area: External package ports Area: BLE Area: Bluetooth Low Energy support Area: LoRa Area: LoRa radio support Area: OTA Area: Over-the-air updates Platform: ESP Platform: This PR/issue effects ESP-based platforms Area: CoAP Area: Constrained Application Protocol implementations Area: cpu Area: CPU/MCU ports Area: USB Area: Universal Serial Bus Area: sys Area: System Area: examples Area: Example Applications labels Mar 7, 2024
@benpicco benpicco added Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 7, 2024
@riot-ci
Copy link

riot-ci commented Mar 7, 2024

Murdock results

✔️ PASSED

ff8eaec treewide: remove THREAD_CREATE_STACKTEST from thread creation

Success Failures Total Runtime
10009 0 10009 09m:19s

Artifacts

@maribu
Copy link
Member

maribu commented Mar 7, 2024

I think @nmeum had a similar PR open. Maybe it makes sense to revisit that and why that has not been merged?

@kfessel
Copy link
Contributor

kfessel commented Mar 8, 2024

I think @nmeum had a similar PR open. Maybe it makes sense to revisit that and why that has not been merged?

#18448 (comment)

seems like something about short lived threads -- i am not sure how common they are

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: BLE Area: Bluetooth Low Energy support Area: CoAP Area: Constrained Application Protocol implementations Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: cpu Area: CPU/MCU ports Area: examples Area: Example Applications Area: LoRa Area: LoRa radio support Area: network Area: Networking Area: OTA Area: Over-the-air updates Area: pkg Area: External package ports Area: sys Area: System Area: tests Area: tests and testing framework Area: USB Area: Universal Serial Bus CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ESP Platform: This PR/issue effects ESP-based platforms Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants