Switch aarch64 pause to sb on armv9a+#2390
Closed
Nicoshev wants to merge 1 commit intofacebook:mainfrom
Closed
Conversation
Summary: SB (Speculation Barrier) is a modern barrier, mandatory from armv8.5a. It achieves the same result as issuing DSB+ISB, but without having the cpu drop its instruction pipeline. We have noticed 20% to 30% increased throughput, on the 16, 32 and 64 thread-count case within the small locks benchmark. In the below results, 'Sum' is throughput: before: ------- folly::MicroSpinLock 16 threads Sum: 130891978 Mean: 1817944 stddev: 147111 Lock time stats in us: mean 1 stddev 33 max 14937 ------- folly::MicroSpinLock 32 threads Sum: 54681548 Mean: 759465 stddev: 105588 Lock time stats in us: mean 5 stddev 78 max 35925 ------- folly::MicroSpinLock 64 threads Sum: 24013546 Mean: 333521 stddev: 90571 Lock time stats in us: mean 11 stddev 179 max 90498 after: ------- folly::MicroSpinLock 16 threads Sum: 169135465 Mean: 2349103 stddev: 227369 Lock time stats in us: mean 1 stddev 25 max 8463 ------- folly::MicroSpinLock 32 threads Sum: 67853388 Mean: 942408 stddev: 108821 Lock time stats in us: mean 3 stddev 63 max 17020 ------- folly::MicroSpinLock 64 threads Sum: 28845120 Mean: 400626 stddev: 61624 Lock time stats in us: mean 9 stddev 149 max 30879 Reviewed By: Gownta Differential Revision: D70250662
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D70250662 |
Nicoshev
added a commit
to Nicoshev/folly
that referenced
this pull request
Feb 26, 2025
Summary: SB (Speculation Barrier) is a modern barrier, mandatory from armv8.5a. It achieves the same result as issuing DSB+ISB, but without having the cpu drop its instruction pipeline. We have noticed 20% to 30% increased throughput, on the 16, 32 and 64 thread-count case within the small locks benchmark. In the below results, 'Sum' is throughput: before: ------- folly::MicroSpinLock 16 threads Sum: 130891978 Mean: 1817944 stddev: 147111 Lock time stats in us: mean 1 stddev 33 max 14937 ------- folly::MicroSpinLock 32 threads Sum: 54681548 Mean: 759465 stddev: 105588 Lock time stats in us: mean 5 stddev 78 max 35925 ------- folly::MicroSpinLock 64 threads Sum: 24013546 Mean: 333521 stddev: 90571 Lock time stats in us: mean 11 stddev 179 max 90498 after: ------- folly::MicroSpinLock 16 threads Sum: 169135465 Mean: 2349103 stddev: 227369 Lock time stats in us: mean 1 stddev 25 max 8463 ------- folly::MicroSpinLock 32 threads Sum: 67853388 Mean: 942408 stddev: 108821 Lock time stats in us: mean 3 stddev 63 max 17020 ------- folly::MicroSpinLock 64 threads Sum: 28845120 Mean: 400626 stddev: 61624 Lock time stats in us: mean 9 stddev 149 max 30879 Reviewed By: Gownta Differential Revision: D70250662
Nicoshev
added a commit
to Nicoshev/hhvm
that referenced
this pull request
Feb 26, 2025
Summary: X-link: facebook/folly#2390 SB (Speculation Barrier) is a modern barrier, mandatory from armv8.5a. It achieves the same result as issuing DSB+ISB, but without having the cpu drop its instruction pipeline. We have noticed 20% to 30% increased throughput, on the 16, 32 and 64 thread-count case within the small locks benchmark. In the below results, 'Sum' is throughput: before: ------- folly::MicroSpinLock 16 threads Sum: 130891978 Mean: 1817944 stddev: 147111 Lock time stats in us: mean 1 stddev 33 max 14937 ------- folly::MicroSpinLock 32 threads Sum: 54681548 Mean: 759465 stddev: 105588 Lock time stats in us: mean 5 stddev 78 max 35925 ------- folly::MicroSpinLock 64 threads Sum: 24013546 Mean: 333521 stddev: 90571 Lock time stats in us: mean 11 stddev 179 max 90498 after: ------- folly::MicroSpinLock 16 threads Sum: 169135465 Mean: 2349103 stddev: 227369 Lock time stats in us: mean 1 stddev 25 max 8463 ------- folly::MicroSpinLock 32 threads Sum: 67853388 Mean: 942408 stddev: 108821 Lock time stats in us: mean 3 stddev 63 max 17020 ------- folly::MicroSpinLock 64 threads Sum: 28845120 Mean: 400626 stddev: 61624 Lock time stats in us: mean 9 stddev 149 max 30879 Reviewed By: Gownta Differential Revision: D70250662
Contributor
|
This pull request has been merged in b22f4c5. |
facebook-github-bot
pushed a commit
to facebook/hhvm
that referenced
this pull request
Feb 27, 2025
Summary: Pull Request resolved: #9591 X-link: facebook/folly#2390 SB (Speculation Barrier) is a modern barrier, mandatory from armv8.5a. It achieves the same result as issuing DSB+ISB, but without having the cpu drop its instruction pipeline. We have noticed 20% to 30% increased throughput, on the 16, 32 and 64 thread-count case within the small locks benchmark. In the below results, 'Sum' is throughput: before: ------- folly::MicroSpinLock 16 threads Sum: 130891978 Mean: 1817944 stddev: 147111 Lock time stats in us: mean 1 stddev 33 max 14937 ------- folly::MicroSpinLock 32 threads Sum: 54681548 Mean: 759465 stddev: 105588 Lock time stats in us: mean 5 stddev 78 max 35925 ------- folly::MicroSpinLock 64 threads Sum: 24013546 Mean: 333521 stddev: 90571 Lock time stats in us: mean 11 stddev 179 max 90498 after: ------- folly::MicroSpinLock 16 threads Sum: 169135465 Mean: 2349103 stddev: 227369 Lock time stats in us: mean 1 stddev 25 max 8463 ------- folly::MicroSpinLock 32 threads Sum: 67853388 Mean: 942408 stddev: 108821 Lock time stats in us: mean 3 stddev 63 max 17020 ------- folly::MicroSpinLock 64 threads Sum: 28845120 Mean: 400626 stddev: 61624 Lock time stats in us: mean 9 stddev 149 max 30879 Reviewed By: Gownta Differential Revision: D70250662 fbshipit-source-id: 4148100a7368c6dc76c36e2ab88d4d2dabe88904
|
Checked using SB with the lockhammer benchmarks and saw a perf improvement of 11-18% |
|
@AGSaidi is lockhammer OSS? if so, could you share your code change in lockhammer? |
This was referenced May 14, 2025
Closed
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
SB (Speculation Barrier) is a modern barrier, mandatory from armv8.5a.
It achieves the same result as issuing DSB+ISB, but without having the cpu drop its instruction pipeline.
We have noticed 20% to 30% increased throughput, on the 16, 32 and 64 thread-count case within the small locks benchmark.
In the below results, 'Sum' is throughput:
before:
------- folly::MicroSpinLock 16 threads
Sum: 130891978 Mean: 1817944 stddev: 147111
Lock time stats in us: mean 1 stddev 33 max 14937
------- folly::MicroSpinLock 32 threads
Sum: 54681548 Mean: 759465 stddev: 105588
Lock time stats in us: mean 5 stddev 78 max 35925
------- folly::MicroSpinLock 64 threads
Sum: 24013546 Mean: 333521 stddev: 90571
Lock time stats in us: mean 11 stddev 179 max 90498
after:
------- folly::MicroSpinLock 16 threads
Sum: 169135465 Mean: 2349103 stddev: 227369
Lock time stats in us: mean 1 stddev 25 max 8463
------- folly::MicroSpinLock 32 threads
Sum: 67853388 Mean: 942408 stddev: 108821
Lock time stats in us: mean 3 stddev 63 max 17020
------- folly::MicroSpinLock 64 threads
Sum: 28845120 Mean: 400626 stddev: 61624
Lock time stats in us: mean 9 stddev 149 max 30879
Reviewed By: Gownta
Differential Revision: D70250662