Skip to content
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

SBLK_MASK_LOCK_THREADID allow tid up to 65535 (#88772) #89335

Conversation

cshung
Copy link
Member

@cshung cshung commented Jul 22, 2023

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 requirements

Testing

  • GC Perf Sim
    • Normal Server
    • Normal Workstation
    • Large Pages Server
    • Large Pages Workstation
    • Low Memory Container
    • High Memory Load
  • Microbenchmarks
    • Workstation
    • Server
  • ASPNet Benchmarks
    • JsonMin_Windows
    • Fortunes ETF_Windows
    • Stage1Grpc_Windows

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.

* SBLK_MASK_LOCK_THREADID allow tid up to 65535

* copy comment from NativeAOT ObjectHeader.cs

---------

Co-authored-by: dickens <[email protected]>
@ghost ghost assigned cshung Jul 22, 2023
@teo-tsirpanis teo-tsirpanis added this to the 7.0.x milestone Jul 23, 2023
@carlossanlop
Copy link
Member

Friendly reminder: if you want this servicing fix to be included in the September 2023 Release, you'll have to merge this PR before August 14th.

@cshung cshung requested a review from Maoni0 August 3, 2023 03:43
@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Aug 9, 2023
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved. we will take for consideration in 7.0.x

@jeffschwMSFT jeffschwMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Aug 10, 2023
@jeffschwMSFT jeffschwMSFT modified the milestones: 7.0.x, 7.0.11 Aug 10, 2023
@jeffschwMSFT jeffschwMSFT merged commit 078e669 into dotnet:release/7.0-staging Aug 10, 2023
110 of 116 checks passed
@cshung cshung deleted the backport/pr-88772-to-release/7.0-staging branch August 10, 2023 20:50
@ghost ghost locked as resolved and limited conversation to collaborators Sep 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-VM-coreclr Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants