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

runtime: shrink signal stacks with AT_MINSIGSTKSZ #54088

Open
prattmic opened this issue Jul 27, 2022 · 1 comment
Open

runtime: shrink signal stacks with AT_MINSIGSTKSZ #54088

prattmic opened this issue Jul 27, 2022 · 1 comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@prattmic
Copy link
Member

A new auxiliary vector, AT_MINSIGSTKSZ was added for arm64 in Linux 4.18, amd64 in Linux 5.14, and ppc64 in Linux 5.19.

AT_MINSIGSTKSZ reports the size of a signal frame, and thus the absolute minimum amount of space required to receive a signal, though additional space is of course required for userspace stack usage.

Currently we hard-code our signal stacks to 32KB. With AT_MINSIGSTKSZ, I think we could adjust this to something like AT_MINSIGSTKSZ + _StackFixed, which would almost certainly reduce the signal stack size on all systems (AT_MINSIGSTKSZ is 3632 bytes on my Skylake machine).

cc @aclements @cherrymui

@prattmic prattmic added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 27, 2022
@prattmic prattmic added this to the Backlog milestone Jul 27, 2022
@cherrymui
Copy link
Member

Sounds like a good idea. Thanks.

Currently there are code that depend on the signal stack being its own manual span. That needs to be adjusted if the stack is smaller and allocated from a stack pool.

@cherrymui cherrymui added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Development

No branches or pull requests

2 participants