-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Mono async stackwalk when hitting AOT frames in stacks. (#52309)
EventPipe sample profiler on Mono hit a couple of issues doing async stack walks when having AOT frames in stack. EventPipe background threads (diagnostic server and streaming threads) where not part of sample profiler STW. Include all except threads marked as no GC threads in STW, but don't include threads marked as no sample in sampling. Aot jit info is cached in a separate list when doing async stackwalks, that list is then not visible through regular jit table meaning that EventPipe session rundown won't include mappings for these IP's. Fix is to detect that a stack walk includes async frames and then (after world as been restarted), registers these IP's in regular JIT table. Fixed a couple of cases in decode_exception_debug_info that still took runtime locks even when in async mode leading to deadlocks. Aot jit info cache used in async mode could leak a lot of memory the way its currently grow the list and was only designed to include a small number of jit info structs. Change it into a simple fixed sized hash table with a max bucket size of 32, hash table get allocated on first need and each jit info will be placed into its bucket based on its method id. Running on a full AOT version of S.P.C we have ~30K methods, this will allocate a little under 1000 buckets consuming 8KB of memory on x64. Other alternative would be to alloc full array using amodule->info.nmethods, that would however be much more memory intensive and would consume ~240KB for S.P.C on x64.
- Loading branch information
1 parent
7ad6cca
commit 9c54ae4
Showing
2 changed files
with
93 additions
and
52 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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