-
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
pal init: Init membarrier() before first thread to improve start time #106724
pal init: Init membarrier() before first thread to improve start time #106724
Conversation
10107a0
to
27896a2
Compare
… improve start time InitializeFlushProcessWriteBuffers() initializes expedited membarrier() syscall on Linux, which is much slower when called in a multi-thread process. Move this init earlier to improve dotnet process start time. A detailed explanation can be found in issue 106722. Fixes dotnet#106722
27896a2
to
bc7dbdd
Compare
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.
Looks great! Thank you
Could you please accept the Contributor License Agreement?
@dotnet-policy-service agree company="Amazon" |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@jkotas, is it possible to backport this change to dotnet8? |
/backport to release/9.0 |
Started backporting to release/9.0: https://github.com/dotnet/runtime/actions/runs/10514758065 |
I can backport it to .NET 9 RC for now. This change does not meet our default servicing bar. It is a perf fix that is not fixing a regression, the problem existed for number of years since membarrier was introduced. Given that the fix is very simple and it provides measurable improvement for every app, I can ask for an exception for .NET 8 backport after the fix bakes for several months in main and .NET 9. |
pal init: InitializeFlushProcessWriteBuffers() before first thread to improve start time
InitializeFlushProcessWriteBuffers() initializes expedited membarrier()
syscall on Linux, which is much slower when called in a multi-thread
process. Move this init earlier to improve dotnet process start time.
A detailed explanation can be found in issue 106722.
Fixes #106722