Skip to content

Equalize marklists #41599

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

Merged
merged 32 commits into from
Dec 8, 2020
Merged

Equalize marklists #41599

merged 32 commits into from
Dec 8, 2020

Conversation

PeterSolMS
Copy link
Contributor

Equalize mark lists across GC heaps in Server GC.

With real world workloads, we observe that the size of the mark lists is often very uneven across the heaps. This will also lead to uneven sort times across the heaps. As the GC threads need to synchronize at the end of sort_mark_list, the GC threads with less work will need to wait for those with more work to finish.

Therefore, it should be advantageous to even out the workload before we start sorting.

This PR does this adding a new method equalize_mark_lists that is called at the beginning of sort_mark_list. This method is executed in parallel on all GC threads and computes what pieces of the mark list need to be moved from one heap to another to achieve an even distribution. To avoid additional synchronization, each GC thread only writes its own mark list, and treats the other mark lists as read-only.

@ghost
Copy link

ghost commented Aug 31, 2020

Tagging subscribers to this area: @dotnet/gc
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@Maoni0 Maoni0 left a comment

Choose a reason for hiding this comment

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

LGTM; there's some trivial styling things that I'll point out when we talk.

@Maoni0 Maoni0 added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Sep 8, 2020
@Maoni0
Copy link
Member

Maoni0 commented Sep 8, 2020

@PeterSolMS is on vacation and he didn't want to merge this till he gets back so please do not merge.

@PeterSolMS PeterSolMS removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Dec 2, 2020
@PeterSolMS
Copy link
Contributor Author

I analyzed perf traces from a first party customer (Bing). To estimate the impact of this change on GC pause time, I computed the difference of the last and first CPU samples spent in relevant methods for each ephemeral GC.

Here are charts and averages:

image

The summary information for an hour of runtime with and without this change shows a reduction of mean pause time of 2.0 milliseconds or 3.2%.

@PeterSolMS PeterSolMS merged commit 3565463 into dotnet:master Dec 8, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants