Skip to content

Conversation

@tommcdon
Copy link
Member

@tommcdon tommcdon commented Jul 9, 2025

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.

@tommcdon tommcdon requested review from Copilot and janvorli July 9, 2025 16:55
@tommcdon tommcdon self-assigned this Jul 9, 2025
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 9, 2025
@tommcdon tommcdon added this to the 10.0.0 milestone Jul 9, 2025
@tommcdon tommcdon added area-VM-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jul 9, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 if so 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_ThreadGuardPages now applies as an opt-in setting on 32-bit hosts as well.
#endif // HOST_64BIT

src/coreclr/vm/threads.cpp:6144

  • Consider using ThreadGuardPages > 0 instead of != 0 to prevent negative values from reducing the guard size unexpectedly.
        if (ThreadGuardPages != 0)

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

@tommcdon tommcdon enabled auto-merge (squash) July 10, 2025 15:33
Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@tommcdon tommcdon merged commit 8aaf1be into dotnet:main Jul 10, 2025
94 of 97 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants