- Notifications
You must be signed in to change notification settings - Fork5.2k
pal init: Init membarrier() before first thread to improve start time#106724
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 ourterms of service andprivacy 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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
10107a0 to27896a2CompareUh oh!
There was an error while loading.Please reload this page.
… improve start timeInitializeFlushProcessWriteBuffers() initializes expedited membarrier()syscall on Linux, which is much slower when called in a multi-threadprocess. Move this init earlier to improve dotnet process start time.A detailed explanation can be found in issue 106722.Fixesdotnet#106722
27896a2 tobc7dbddCompare
jkotas left a comment
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?
harisokanovic commentedAug 21, 2024
@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.
harisokanovic commentedAug 21, 2024
harisokanovic commentedAug 22, 2024
@jkotas, is it possible to backport this change to dotnet8? |
jkotas commentedAug 22, 2024
/backport to release/9.0 |
Started backporting to release/9.0:https://github.com/dotnet/runtime/actions/runs/10514758065 |
jkotas commentedAug 22, 2024
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. |
Uh oh!
There was an error while loading.Please reload this page.
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