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

Do page free'ing outside STW #50320

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Do page free'ing outside STW #50320

wants to merge 1 commit into from

Conversation

vchuravy
Copy link
Sponsor Member

#48969 add a utility thread that would concurrently to the mutator threads
perform the cleanup work required to return pages to the OS.

During performance anlysis I saw on some benchmarks negative effects due
to syscalls causing iTLB flushes (caused by Meltdown mitigations).

For that reason and due to not wanting to oversubscribe the users system,
we by default turned the utility thread off, and require explicit enablement
through --gcthreads=N,1.

The overall goal was to shorten the STW phase by moving the work out of the
critical section. This PR finds a middle-ground and moves the page freeing work
before finalizers are being called, e.g. outside the STW phase.

I still need to do some more performance analysis, especially since I am still
seeing iTLB flushes on the tree benchmarks.

As a note the utility thread opens up the possibility to move the finalizers to
that thread as well.

My general tuning advise is to use --gcthreads=N,1 if your application is latency
sensitive and --gcthreads=N,0 if you are worried about oversubscription.

@vchuravy vchuravy added performance Must go faster GC Garbage collector labels Jun 28, 2023
@vchuravy vchuravy requested a review from d-netto June 28, 2023 08:07
@d-netto
Copy link
Member

d-netto commented Jun 28, 2023

I can see how this would allow us to do some concurrent sweeping without the need of using an additional sweeping thread (and thus oversubscribing the system in some cases).

Why does this help with the TLB misses?

@vchuravy
Copy link
Sponsor Member Author

Why does this help with the TLB misses?

It doesn't but finalizers calling free would have a similar effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GC Garbage collector performance Must go faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants