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

[NOT TO MERGE YET] 8258604: Use 'isb' instruction in SpinPause on linux-aarch64 #5112

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -382,7 +382,10 @@ int os::extra_bang_size_in_bytes() {

extern "C" {
int SpinPause() {
return 0;
// ISB creates a small delay without consuming ALU resources.
// This allows it to act as x86 PAUSE.
__asm volatile("isb");
Copy link
Contributor

@stooart-mon stooart-mon Oct 1, 2021

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.

Copy link
Contributor Author

@eastig eastig Oct 1, 2021

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.

return 1;
}

void _Copy_conjoint_jshorts_atomic(const jshort* from, jshort* to, size_t count) {