-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[NativeAOT] Make conservative stack reporting configurable. #75803
Conversation
@@ -16,6 +16,7 @@ DEBUG_CONFIG_VALUE_WITH_DEFAULT(BreakOnAssert, 1) | |||
RETAIL_CONFIG_VALUE(StressLogLevel) | |||
RETAIL_CONFIG_VALUE(TotalStressLogSize) | |||
RETAIL_CONFIG_VALUE(gcServer) | |||
RETAIL_CONFIG_VALUE(GcConservativeStacks) // Enables conservative stack reporting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should call it the same thing as in CoreCLR (
runtime/src/coreclr/inc/clrconfigvalues.h
Line 268 in 242c95a
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_gcConservative, W("gcConservative"), 0, "Enables/Disables conservative GC") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gcConservative
turns support for conservative reporting in the GC. NativeAOT enables that unconditionally.
I think if we use the same key we will see it always "on".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gcConservative
turns on conservative stack scanning in CoreCLR:
runtime/src/coreclr/vm/gcenv.ee.cpp
Line 129 in 4cf2e3b
if (g_pConfig->GetGCConservative()) |
NativeAOT enables that unconditionally. I think if we use the same key we will see it always "on".
The GC should see it as always on in NativeAOT, but the runtime should use the env variable that you are adding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it looks like we intercept gcConservative
when GC asks about it. We may be able to use the same key.
Another issue could be that gcConservative
would affect the test infrastructure as well as NativeAOT tests. That is probably ok.
Thanks! |
Follow up to dotnet#75803. If enabled, conservative GC stack scanning will be used and metadata related to GC stack reporting will not be generated. The generated executable file will be smaller, but the GC will be less efficient (garbage collection might take longer and keep objects alive for longer periods of time than usual). Saves 4.4% in size on a Hello World. I'll take that.
Conservative stack reporting is a convenient option when investigating issues with suspension/unwinding/root reporting.
Having to rebuild the runtime and testcases in order to switch is not convenient though as switching back and forth takes a very long time.
This change allows turning conservative stack reporting off/on via environment variable.