-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add randomized allocation sampling #100356
Closed
Closed
Changes from all commits
Commits
Show all changes
95 commits
Select commit
Hold shift + click to select a range
3815aa8
This is an incomplete implementation of a new randomized allocation s…
noahfalk 6a92fcb
Initial update
chrisnas cdbffc3
Update based on feedback
chrisnas 924afd0
Rename fast_alloc_helper_limit_ptr to alloc_sampling
chrisnas e0ce093
Remove trailing whitespace in markdown
chrisnas 396c05e
Add sampling threshold computation
chrisnas 91b8b79
Take feedback into account and start to implement AllocationSampled e…
chrisnas 65ff391
Fix typo
chrisnas b25adc6
Take review into account
chrisnas d939cdd
Emit the AllocationSampled event
chrisnas 9b0f7da
Fix threshold computation error
chrisnas 8875a4d
Deal with empty allocation context when fixing them
chrisnas f39a732
Handle the case of objects larger than an allocation context
chrisnas fbc0b6b
Take review into account
chrisnas 32eb2fa
Take review into account for dynamically sampling
chrisnas 518b4f7
Adding a first test that AllocationSampled is emitted when keyword/ve…
chrisnas b596f33
Check type name in AllocationSampled test
chrisnas 984ed95
Compare perf impact of allocation sampling
chrisnas 1c46a5d
Fix tests
chrisnas 44e914b
Update tests and doc
chrisnas 9eba36e
Update review
chrisnas b7614fd
Update based on review
chrisnas cbc5a12
Add tests and simple framework to measure statistical distribution of…
chrisnas 826d8eb
Add x1/x2/x3 ratio check
chrisnas a56a5ee
Update array of double implementation for 32 bits
chrisnas 48dbfa1
Updates
chrisnas 7280c13
Fix markdown
chrisnas fd8a1b9
Add AllocationsRunEventSource to compute percentiles more easily
chrisnas a4aef1a
Allow percentiles computation
chrisnas 08ec139
Add ratio based array allocations
chrisnas 0bbbfa9
take review into account
chrisnas cf29e9b
Refactor the code and update upscaling method
chrisnas 26e8fe0
Add runs for allocations
chrisnas 52d4071
Handle padding for objects alignment
chrisnas db506a3
take GC padding into account
chrisnas 8522866
Update allocation sampling distribution results
chrisnas e1f8ece
Update benchmarks with events
chrisnas 32f6d31
Beginning of NativeAOT support
chrisnas 9e31a6e
Fix trailing spaces
chrisnas f9f5224
Updates based on PR comments
chrisnas 97a3bbd
Proposed changes
noahfalk 734b773
Fix README
noahfalk a6120ac
- fix Alloc helper to get the address of the allocated object for All…
chrisnas 3d0bcd1
Update the design doc
noahfalk 549e7b0
Merge branch 'main' into chrisnas/alloc_sampling
chrisnas 147447a
Fix compilation errors for Linux and related to merged changes in Thr…
chrisnas 2b41997
Fix compilation issue
chrisnas 4618b37
Restore Thread randomizer initialization
chrisnas 918fe0c
Remove the randomizer from Thread to have just a singleton
chrisnas e82162d
Add a lazily allocated CLRRandom in Thread class
chrisnas 09eae74
Start a no op implementation of randomized sampling for NativeAOT
chrisnas 6badfb2
Fix typos in markdown
chrisnas d0e46a4
Fix linux compilation errors
chrisnas ef5b819
Make alloc context randomizer per thread lazily allocated
chrisnas ff77f7a
Fix missing rename in assembly code to use combined_limit instead of …
chrisnas 77cb736
Fix build errors dues to explicit net8.0 usage in tests
chrisnas c40b1a2
Filter out AllocationTick when AllocationSampled is enabled
chrisnas a62ea75
Try a fix for build errors related to .csproj that are not really tests
chrisnas 07ab88b
Avoid touching the IGCToCLREventSink interface because AllocationSampled
chrisnas d04b655
Update AllocationTick filtering implementation
chrisnas d565045
Fix double[] implementation
chrisnas b7bd18f
Fix test due to added field in the event payload
chrisnas 7cbcb43
Implement emitting the AllocationSampled event in NativeAOT
chrisnas 86f24c6
First no op implementation for NativeAOT with updated assembly code
chrisnas 51d9935
Fix typos
chrisnas a9ef0e5
Fix DEBUG compilation error
chrisnas dd7e00d
Fix linux/x86 compilation errors
chrisnas a86a98b
Fix build error
chrisnas 512f011
Try to fix "static" related compilation errors
chrisnas 532f095
Fix test in 32 bit
chrisnas 4fc9b8d
Avoid running AllocationSampled test with Mono + Fix compilation issue
chrisnas 9174212
Start to implement the randomizer with existing 32 bit random
chrisnas 541f59f
Fix compilation error
chrisnas 40f96f3
Allow eventing functions to be called from thread.cpp
chrisnas 29c16b5
Merge branch 'main' into chrisnas/alloc_sampling
chrisnas 20c6d51
Fix assert in AOT
chrisnas c5ccad8
Fix link issue
chrisnas 39afdf2
Fix NativeAOT build
chrisnas b2db19e
Merge branch 'main' into chrisnas/alloc_sampling
chrisnas e4ef681
Fix missing references to gc_alloc_context
chrisnas abfe6cb
Fix compilation issues
chrisnas 997a293
Update x86 implementation
chrisnas 041e397
Fix
chrisnas e312bf6
Fixes
chrisnas ec16fa0
Merge remote-tracking branch 'origin' into chrisnas/alloc_sampling
chrisnas fd382d3
Fix rebase
chrisnas a2e30cc
Fix linux gcc build issues
chrisnas 83611b8
Add missing alloc context fixup and randomizer code
chrisnas c908fe4
Merge remote-tracking branch 'origin' into chrisnas/alloc_sampling
chrisnas dc02b7c
Fix issue when TLS for alloc context is not initialized
chrisnas 85625cd
Merge remote-tracking branch 'origin' into chrisnas/alloc_sampling
chrisnas 911d5d7
Change randomizer to use sxoshiro128++ for better statistical distrib…
chrisnas 91d58dc
Fix possible crash in GCInterface_GetTotalAllocatedBytesPrecise
chrisnas 11177d9
Fix possible desync between gc_alloc_context and combined_limit
chrisnas ce40d3d
Merge remote-tracking branch 'origin' into chrisnas/alloc_sampling
chrisnas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
You may already have this on a list somewhere, but
name
is alwaysnull
(I'm not sure that nativeaot even has the type name data available...)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.
I'm reusing the same code as AllocationTick to get the type name and it is working in the tests for Core. I'll try the same code for NativeAOT when the compilations errors are fixed.
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.
Sounds good. I suspect that nativeaot doesn't even have the type names, so it may just always need to be null, but wanted to call it out.
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.
Sorry @brianrob!
I missed that your point was for NativeAOT only!