SBLK_MASK_LOCK_THREADID allow tid up to 65535 (#88772) #89335
Merged
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.
Customer Impact - from @dickens-code
Our apps require low latency performance and we are trying hard to reduce memory allocation in order to minimise GC occurrences.
We noticed that one of our apps experiences a very long GC pause of 2 seconds, and with the help of @cshung, we discovered that our app is having very large sync block memory space (20 million sync blocks), which introduced a very long time of sync block scanning during GC events.
We found out that new sync blocks are introduced when thread ID > 1024 is taking object locks and we tried to release the limit of thread ID to 65535 and the sync block memory space size was obviously improved
With the custom-built
coreclr.dll
we observed that our app's GC pauses were brought down to around 100ms which makes more sense according to our business requirementsTesting
Test failures are known - on my machine, I don't have sufficient memory to pass the 20GB large pages test case, all other large page test cases are passing.
Risk
Low - the bits were not used for anything before this fix, and the change is merged to main for 2 weeks with no regression found.