Enable DOTNET_ThreadGuardPages opt-in config setting on 32-bit#117466
Merged
tommcdon merged 3 commits intodotnet:mainfrom Jul 10, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR moves the DOTNET_ThreadGuardPages configuration check out of the 64-bit-only block so that 32-bit hosts can opt into custom guard pages instead of always using the default.
- Inverts the
ifso non-zero config applies on all platforms - Retains default guard pages only for 64-bit when config is zero
- Keeps a single debug page on 32-bit regardless of config
Comments suppressed due to low confidence (3)
src/coreclr/vm/threads.cpp:6143
- Add tests to verify the new opt-in behavior on 32-bit: ensure zero (default) yields no extra guard pages and positive values apply correctly.
int ThreadGuardPages = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_ThreadGuardPages);
src/coreclr/vm/threads.cpp:6141
- [nitpick] Update the public configuration docs to note that
DOTNET_ThreadGuardPagesnow applies as an opt-in setting on 32-bit hosts as well.
#endif // HOST_64BIT
src/coreclr/vm/threads.cpp:6144
- Consider using
ThreadGuardPages > 0instead of!= 0to prevent negative values from reducing the guard size unexpectedly.
if (ThreadGuardPages != 0)
Contributor
|
Tagging subscribers to this area: @mangod9 |
janvorli
reviewed
Jul 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves DOTNET_ThreadGuardPages config check out of the 64-bit host check, making the number of pages we save on stackoverflow on 32-bit configurable.