-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Make ETW rundown operate more effectively with JIT #116354
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
Make ETW rundown operate more effectively with JIT #116354
Conversation
Rename some locals removing critical section notion and replace with lock. Rework the CodeHeapIterator. Rename members to more accurately reflect their purpose. Generally move to more canonical C++. EECodeGenManager now has a iterator counter. This is used to track the number of outstanding iterators and can be used to defer deletes. Adds are still valid since the iterator will only operate on the state at the time the iterator was created.
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.
Test failures look related:
20:03:09.305 Running test: tracing/runtimeeventsource/nativeruntimeeventsource/nativeruntimeeventsource.cmd
ASSERT FAILED
Expression: codeLength > 0
Location: line 1866 in /Users/runner/work/1/s/src/coreclr/vm/eetwain.cpp
Narrow contract
Yep. I'm trying to root it out on macOS. I tried on Windows and did find a contract violation that I needed to fix. I pushed up that fix and will see where we are. |
possible due to MethodDesc iteration. Rework how DynamicMethodDesc and LCGMethodResolver destruction works. This was needed due to Crst lock inversion. Remove CrstIbcProfile
Rework allocation order for recording of code pointer.
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.
Pull Request Overview
This pull request modernizes the code heap management in the CLR's ETW integration to improve JIT rundown operations. The PR simplifies the EECodeGenManager
API surface, reworks the CodeHeapIterator
to be more robust, and ensures all methods emit unwind information for better ETW stack tracing.
Key changes include:
- Refactored ETW rundown and JIT manager interfaces for better code heap iteration
- Improved dynamic method destruction workflow with deferred cleanup
- Enhanced thread safety for code heap operations during iteration
Reviewed Changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 6 comments.
Show a summary per file
File | Description |
---|---|
src/coreclr/vm/threads.h | Removes finalizer-related methods from Thread class |
src/coreclr/vm/threads.cpp | Removes finalizer work methods moved to FinalizerThread |
src/coreclr/vm/finalizerthread.h | Adds delayed dynamic method destruction support |
src/coreclr/vm/finalizerthread.cpp | Implements delayed dynamic method cleanup functionality |
src/coreclr/vm/runtimehandles.cpp | Updates dynamic method destruction to use delayed cleanup |
src/coreclr/vm/codeman.h | Modernizes CodeHeapIterator and UnwindInfoTable APIs |
src/coreclr/vm/codeman.cpp | Major refactoring of code heap management and iteration |
src/coreclr/vm/dynamicmethod.h | Restructures LCGMethodResolver for better lifecycle management |
src/coreclr/vm/dynamicmethod.cpp | Implements staged destruction with iterator-safe cleanup |
src/coreclr/vm/jitinterface.h | Removes obsolete BackoutJitData methods |
src/coreclr/vm/jitinterface.cpp | Simplifies JIT compilation error handling |
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.
LGTM. Thank you!
Fixes #102858
Make the
EECodeGenManager
API surface narrower.Rename some locals removing critical section notion and replace with lock.
Rework the
CodeHeapIterator
.Rename members to more accurately reflect their purpose. Generally move to more canonical C++.
EECodeGenManager
now has an iterator counter. This is used to track the number of outstanding iterators and can be used to defer deletes. Adds are still valid since the iterator will only operate on the state at the time the iterator was created.Always emit UnwindInfo for methods. This was previously only enabled when the Runtime provider was enabled and a rundown triggered.