Skip to content

Add back pthread_attr_setstacksize update #1

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

Merged
merged 9 commits into from
Jan 10, 2024

Conversation

chinglee-iot
Copy link

Add back pthread_attr_setstacksize update

Description

In this PR

  • Add back pthread_attr_setstacksize change
  • Stop the timer in vPortEndScheduler
  • Move list insert and remove function call to a critical section
  • Create cancellation point in prvSuspendSelf function

Test Steps

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@cmorganBE
Copy link
Owner

Oh I did miss a couple of formatting things. You'll fixup the original commits with a git rebase? Did you want me to look at doing that?

I think the only objection I'd have is putting back pthread_attr_setstacksize(). It will result in valgrind false positives for reused stacks (such as a second start of a thread on the same stack memory) as valgrind is tracking the stack pointer as it moves. There are ways to let valgrind know about this but it seems complex and would mean the port would have to link against and call some advanced valgrind functions, https://valgrind.org/docs/manual/manual-core-adv.html

@chinglee-iot
Copy link
Author

Let me update the PR again to revert pthread_attr_setstacksize.
You can take a look at this PR. If it is good enough to you, you can merge this PR in your branch.

@cmorganBE
Copy link
Owner

@chinglee-iot alright, so I removed the stack size commit from cmm_posix during the rebase (I think by accident but unless you see it there I don't see it here). So it probably makes sense for you to confirm you need your commit to revert it and I can open up a separate PR to address the stack size changes once this is merged, if that works.

@cmorganBE
Copy link
Owner

@chinglee-iot ok if I rebase your branch into mine to clean up the history? if so I can do that now

@cmorganBE
Copy link
Owner

and by that last comment, these changes look good, I can merge/rebase your changes into the cmm_posix changes to update those two commits and keep the history cleaner on the merge side of the main repo

@chinglee-iot
Copy link
Author

Usually we will do squash and merge. It is not necessary to rebase.
It looks like you have concern about using 'pthread_attr_setstacksize` with valgrind.
If you want to add it back, you can add it in this one.

@cmorganBE
Copy link
Owner

@chinglee-iot k, let me do a final review, add that commit in and merge this back in. Thank you for keeping at this one, its probably only important to those of us using the posix port so I appreciate it.

@cmorganBE cmorganBE merged commit c938e61 into cmorganBE:cmm_posix Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants