-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
runtime: add ERMS-based memmove support for modern CPU platforms #66959
Conversation
This PR (HEAD: f3f5b0f) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/580735. Important tips:
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from qiulaidongfeng: Patch Set 1: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Go LUCI: Patch Set 1: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2024-04-22T10:39:48Z","revision":"d49514407921eb0754bda55d3aae8e71336c9fa2"} Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from qiulaidongfeng: Patch Set 1: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Go LUCI: Patch Set 1: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Go LUCI: Patch Set 1: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Keith Randall: Patch Set 1: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Martin Möhrmann: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Martin Möhrmann: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Alexander Yastrebov: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Keith Randall: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Martin Möhrmann: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Mauri de Souza Meneguzzo: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Dmitry Vyukov: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Martin Möhrmann: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
This PR (HEAD: 7f7e861) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/580735. Important tips:
|
Message from Keith Randall: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
This PR (HEAD: 7e2e69c) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/580735. Important tips:
|
Message from Keith Randall: Patch Set 3: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
This PR (HEAD: e030e7c) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/580735. Important tips:
|
Message from Martin Möhrmann: Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from 唐阳: Patch Set 6: (7 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Martin Möhrmann: Patch Set 6: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from 唐阳: Patch Set 6: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Martin Möhrmann: Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Keith Randall: Patch Set 12: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Go LUCI: Patch Set 12: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Go LUCI: Patch Set 12: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
This PR (HEAD: 55a05b3) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/580735. Important tips:
|
Message from 唐阳: Patch Set 13: (5 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Keith Randall: Patch Set 13: Code-Review+2 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Keith Randall: Patch Set 13: Code-Review+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Cherry Mui: Patch Set 13: Code-Review+1 (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from 唐阳: Patch Set 13: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from 唐阳: Patch Set 13: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Cherry Mui: Patch Set 13: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
This PR (HEAD: 5d3dfcb) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/580735. Important tips:
|
Message from 唐阳: Patch Set 14: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from qiu laidongfeng2: Patch Set 14: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Go LUCI: Patch Set 14: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2024-07-01T10:57:31Z","revision":"cd0acea9605c5cb256d2dca3a31c0ed06bb2700f"} Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from qiu laidongfeng2: Patch Set 14: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Go LUCI: Patch Set 14: This CL has failed the run. Reason: Tryjob golang/try/x_tools-gotip-linux-amd64 has failed with summary (view all results):
Build or test failure, click here for results. Additional links for debugging: Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Go LUCI: Patch Set 14: LUCI-TryBot-Result-1 Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
The current memmove implementation uses REP MOVSB to copy data larger than 2KB when the useAVXmemmove global variable is false and the CPU supports the ERMS feature. This feature is currently only enabled on CPUs in the Sandy Bridge (Client) , Sandy Bridge (Server), Ivy Bridge (Client), and Ivy Bridge (Server) microarchitectures. For modern Intel CPU microarchitectures that support the ERMS feature, such as Ice Lake (Server), Sapphire Rapids , REP MOVSB achieves better performance than the AVX-based copy currently implemented in memmove. Benchstat result: goos: linux goarch: amd64 pkg: runtime cpu: Intel(R) Xeon(R) Gold 6348 CPU @ 2.60GHz │ ./old.txt │ ./new.txt │ │ sec/op │ sec/op vs base │ Memmove/2048-2 25.24n ± 0% 24.27n ± 0% -3.84% (p=0.000 n=10) Memmove/4096-2 44.87n ± 0% 33.16n ± 1% -26.11% (p=0.000 n=10) geomean 33.65n 28.37n -15.71% │ ./old.txt │ ./new.txt │ │ B/s │ B/s vs base │ Memmove/2048-2 75.56Gi ± 0% 78.59Gi ± 0% +4.02% (p=0.000 n=10) Memmove/4096-2 85.01Gi ± 0% 115.05Gi ± 1% +35.34% (p=0.000 n=10) geomean 80.14Gi 95.09Gi +18.65% Fixes golang#66958 Signed-off-by: TangYang <yang.tang@intel.com>
This PR (HEAD: 89cf5af) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/580735. Important tips:
|
Message from Keith Randall: Patch Set 15: Code-Review+2 Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Go LUCI: Patch Set 15: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2024-07-02T05:10:01Z","revision":"f67e5a9acf04f5bbba18bf0f81c5f3ec7efbc208"} Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Keith Randall: Patch Set 15: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Go LUCI: Patch Set 15: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Go LUCI: Patch Set 15: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
Message from Keith Randall: Patch Set 15: Auto-Submit+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/580735. |
The current memmove implementation uses REP MOVSB to copy data larger than 2KB when the useAVXmemmove global variable is false and the CPU supports the ERMS feature. This feature is currently only enabled on CPUs in the Sandy Bridge (Client) , Sandy Bridge (Server), Ivy Bridge (Client), and Ivy Bridge (Server) microarchitectures. For modern Intel CPU microarchitectures that support the ERMS feature, such as Ice Lake (Server), Sapphire Rapids , REP MOVSB achieves better performance than the AVX-based copy currently implemented in memmove. Benchstat result: goos: linux goarch: amd64 pkg: runtime cpu: Intel(R) Xeon(R) Gold 6348 CPU @ 2.60GHz │ ./old.txt │ ./new.txt │ │ sec/op │ sec/op vs base │ Memmove/2048-2 25.24n ± 0% 24.27n ± 0% -3.84% (p=0.000 n=10) Memmove/4096-2 44.87n ± 0% 33.16n ± 1% -26.11% (p=0.000 n=10) geomean 33.65n 28.37n -15.71% │ ./old.txt │ ./new.txt │ │ B/s │ B/s vs base │ Memmove/2048-2 75.56Gi ± 0% 78.59Gi ± 0% +4.02% (p=0.000 n=10) Memmove/4096-2 85.01Gi ± 0% 115.05Gi ± 1% +35.34% (p=0.000 n=10) geomean 80.14Gi 95.09Gi +18.65% Fixes #66958 Change-Id: I1fafd1b51a16752f83ac15047cf3b29422a79d5d GitHub-Last-Rev: 89cf5af GitHub-Pull-Request: #66959 Reviewed-on: https://go-review.googlesource.com/c/go/+/580735 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
This PR is being closed because golang.org/cl/580735 has been merged. |
The current memmove implementation uses REP MOVSB to copy data larger than
2KB when the useAVXmemmove global variable is false and the CPU supports
the ERMS feature.
This feature is currently only enabled on CPUs in the Sandy Bridge (Client)
, Sandy Bridge (Server), Ivy Bridge (Client), and Ivy Bridge (Server)
microarchitectures.
For modern Intel CPU microarchitectures that support the ERMS feature, such
as Ice Lake (Server), Sapphire Rapids , REP MOVSB achieves better
performance than the AVX-based copy currently implemented in memmove.
Benchstat result:
goos: linux
goarch: amd64
pkg: runtime
cpu: Intel(R) Xeon(R) Gold 6348 CPU @ 2.60GHz
│ ./old.txt │ ./new.txt │
│ sec/op │ sec/op vs base │
Memmove/2048-2 25.24n ± 0% 24.27n ± 0% -3.84% (p=0.000 n=10)
Memmove/4096-2 44.87n ± 0% 33.16n ± 1% -26.11% (p=0.000 n=10)
geomean 33.65n 28.37n -15.71%
Memmove/2048-2 75.56Gi ± 0% 78.59Gi ± 0% +4.02% (p=0.000 n=10)
Memmove/4096-2 85.01Gi ± 0% 115.05Gi ± 1% +35.34% (p=0.000 n=10)
geomean 80.14Gi 95.09Gi +18.65%
Fixes #66958