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
[NOT TO MERGE YET] 8258604: Use 'isb' instruction in SpinPause on linux-aarch64 #5112
Conversation
|
Webrevs
|
SpinPause() should return 1 if it executes code. See the x86/64 implementations.
Fix: SpinPause() should return 1 if it executes code.
@eastig This change is no longer ready for integration - check the PR body for details. |
/integrate |
@eastig This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
return 0; | ||
// ISB creates a small delay without consuming ALU resources. | ||
// This allows it to act as x86 PAUSE. | ||
__asm volatile("isb"); |
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.
I hadn't realised this was unconditional. Similar to my comment on the onSpinWait patch, while the ISB instruction happens to work for you just now on the platforms you have tested, there is no guarantee that it will continue to do so in future processors.
Could this be made optional? This is awkward, as it is C++ code, but it may have to be a build configuration option.
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.
Hi Stuart,
Yes, I'll be updating it to support different implementations.
@eastig This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
To implement
SpinPause
an instruction creating a small delay without consuming ALU resources is needed. AArch64 has the YIELD instruction but most of AArch64 vendors still implement it as a NOP. It's been found that ISB can create a small delay without consuming ALU resources. It is more reliable than NOPs.This patch implements
SpinPause
with ISB.Testing: gtest, tier1, tier2
Results of https://github.com/ben-manes/caffeine/wiki/Benchmarks
GetPutBenchmark
has 8 threads concurrently working with a cache.GetPutBenchmark.read_only
all 8 thread read from a cache.GetPutBenchmark.write_only
all 8 thread write to a cache.GetPutBenchmark.readwrite
6 threads concurrently read from and 2 threads write to a cache.Improvements when only 4 CPUs are available:
Improvements when only 8 CPUs are available:
LinkedHashMapCache source
Cache2k source
ExpiringMapCache source
GetPutBenchmark source
Progress
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5112/head:pull/5112
$ git checkout pull/5112
Update a local copy of the PR:
$ git checkout pull/5112
$ git pull https://git.openjdk.java.net/jdk pull/5112/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 5112
View PR using the GUI difftool:
$ git pr show -t 5112
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5112.diff