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

Getting vxsort working on Linux amd64 #98712

Merged
merged 1 commit into from
Apr 3, 2024
Merged

Conversation

cshung
Copy link
Member

@cshung cshung commented Feb 20, 2024

This change make vxsort available for other x64 platforms other than Windows. Overall, the algorithm improved the pause time for ephemeral GCs by a few percents. Attached below are the numbers on Linux running GCPerfSim.

This change will increase binary size by a about 130k because VxSort is a lot of code. For NativeAOT, I chose to follow the Windows policy to enable it by default and provided the same opt-out.

It is also tested under Rosetta emulation to show that it will work even on machines without AVX instructions. Of course, VxSort will not be available there and we will use the introsort fallback.

Special thanks to @janvorli for helping with the compilation errors when I was stuck trying to fix them.

Summary

Name ExecutionTime (MSec) - base comparand Δ% % GC Pause Time - base comparand Δ%
normal 25,617.28 25,068.92 -2.14 27.19 25.85 -4.94
soh_pinning 31,713.70 30,949.50 -2.41 36.15 35.95 -0.54
poh 25,309.35 25,176.36 -0.53 26.74 26.18 -2.09
loh 26,479.87 26,054.81 -1.61 23.63 22.68 -4.02
Name Mean Heap Size Before (MB) - base comparand Δ%
normal 6,654.48 6,522.71 -1.98
soh_pinning 7,850.94 7,863.67 0.16
poh 6,715.51 6,641.29 -1.11
loh 6,841.37 6,872.47 0.45
Name Mean Ephemeral Pause (MSec) - base comparand Δ%
normal 27.79 25.98 -6.52
soh_pinning 15.68 15.21 -3.01
poh 27.14 26.37 -2.84
loh 26.31 24.55 -6.69

@ghost ghost assigned cshung Feb 20, 2024
@cshung cshung marked this pull request as draft February 20, 2024 18:55
@ghost
Copy link

ghost commented Feb 20, 2024

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

Issue Details

null

Author: cshung
Assignees: cshung
Labels:

area-GC-coreclr

Milestone: -

@am11
Copy link
Member

am11 commented Mar 10, 2024

The increase in crossgen2 binary size is 133 KB on linux-x64 and 115 KB on osx-x64 (without the last commit). If the performance gain is worth the additional size, can revert 786e0aa and adjust the size test:

upperBound = 1750 * 1024; // ~1.75 MB

1750 -> 1900

@mangod9
Copy link
Member

mangod9 commented Mar 11, 2024

why is this affecting crossgen2 binary sizes? Is this changing any JIT behavior?

@cshung
Copy link
Member Author

cshung commented Mar 11, 2024

why is this affecting crossgen2 binary sizes? Is this changing any JIT behavior?

This change does not change any JIT behavior, it is just that the code for vxsort has a non-trivial size.

@cshung cshung marked this pull request as ready for review March 18, 2024 19:39
src/coreclr/gc/gcsvr.cpp Outdated Show resolved Hide resolved
src/coreclr/gc/gcwks.cpp Outdated Show resolved Hide resolved
@am11
Copy link
Member

am11 commented Mar 28, 2024

One more am11@0dd4664 (I was testing on arm64 machine earlier 😅).

src/native/minipal/utils.h Outdated Show resolved Hide resolved
Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

Co-authored-by: Jan Vorlicek <janvorli@microsoft.com>
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
@cshung cshung merged commit c08bd7b into dotnet:main Apr 3, 2024
163 of 165 checks passed
@cshung cshung deleted the public/linux-vxsort branch April 3, 2024 20:27
shushanhf added a commit to shushanhf/runtime that referenced this pull request Apr 8, 2024
…code`

when building on debug mode on loongarch64/arm64/amd64-linux by clang<=13.

Also delete `#ifndef FALLTHROUGH` block as dotnet#98336 added after dotnet#98712.
shushanhf added a commit to shushanhf/runtime that referenced this pull request Apr 8, 2024
…code`

when building on debug mode on loongarch64/arm64/amd64-linux by clang<14.

Also delete `#ifndef FALLTHROUGH` block as dotnet#98336 added after dotnet#98712.
shushanhf added a commit to shushanhf/runtime that referenced this pull request Apr 8, 2024
…code`

when building on debug mode on loongarch64/arm64/amd64-linux by clang<14.

Also delete `#ifndef FALLTHROUGH` block as dotnet#98336 added after dotnet#98712.
shushanhf added a commit to shushanhf/runtime that referenced this pull request Apr 8, 2024
…code`

when building on debug mode on loongarch64/arm64/amd64-linux by clang<14.

Also delete `#ifndef FALLTHROUGH` block as dotnet#98336 added after dotnet#98712.
shushanhf added a commit to shushanhf/runtime that referenced this pull request Apr 9, 2024
…code`

when building on debug mode on loongarch64/arm64/amd64-linux by clang<14.

Also delete `#ifndef FALLTHROUGH` block as dotnet#98336 added after dotnet#98712.
shushanhf added a commit to shushanhf/runtime that referenced this pull request Apr 9, 2024
…code`

when building on debug mode on loongarch64/arm64/amd64-linux by clang<14.

Also delete `#ifndef FALLTHROUGH` block as dotnet#98336 added after dotnet#98712.
shushanhf added a commit to shushanhf/runtime that referenced this pull request Apr 9, 2024
…code`

when building on debug mode on loongarch64/arm64/amd64-linux by clang<14.

Also delete `#ifndef FALLTHROUGH` block as dotnet#98336 added after dotnet#98712.
AaronRobinsonMSFT pushed a commit that referenced this pull request Apr 9, 2024
…code` (#100742)

when building on debug mode on loongarch64/arm64/amd64-linux by clang<14.

Also delete `#ifndef FALLTHROUGH` block as #98336 added after #98712.
matouskozak pushed a commit to matouskozak/runtime that referenced this pull request Apr 30, 2024
Co-authored-by: Jan Vorlicek <janvorli@microsoft.com>
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
matouskozak pushed a commit to matouskozak/runtime that referenced this pull request Apr 30, 2024
…code` (dotnet#100742)

when building on debug mode on loongarch64/arm64/amd64-linux by clang<14.

Also delete `#ifndef FALLTHROUGH` block as dotnet#98336 added after dotnet#98712.
@github-actions github-actions bot locked and limited conversation to collaborators May 4, 2024
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.

None yet

7 participants