Skip to content

Comments

Adding 'sb' instruction to spin_delay() for ARM v8.5 onward#18

Open
salvatoredipietro wants to merge 1 commit intoaerospike:masterfrom
salvatoredipietro:master
Open

Adding 'sb' instruction to spin_delay() for ARM v8.5 onward#18
salvatoredipietro wants to merge 1 commit intoaerospike:masterfrom
salvatoredipietro:master

Conversation

@salvatoredipietro
Copy link

We would like to propose this optimization for ARM architecture that, at runtime, it switches to SB instruction if supported by the system. SB (Speculation Barrier) is a modern barrier which is available from armv8.5a. It achieves the same result as issuing ISB, but instead of flushing the CPU it does so by serializing older instructions to be non-speculative before it completes. This is less disruptive than an "isb" to high performance CPUs.

We already saw positive improvements on MySQL server (mysql/mysql-server#611) and Folly (facebook/folly#2390).

@salvatoredipietro
Copy link
Author

Can anyone take a look to this and provide some initial feedback, please?

@kportertx kportertx requested a review from xorphox June 12, 2025 17:35
@xorphox
Copy link
Contributor

xorphox commented Jun 12, 2025

Thank you for bringing this to our attention. The code appears reasonable but we will first explore options for our code base which avoids the branching.

@salvatoredipietro
Copy link
Author

thanks @xorphox. Do you have any update about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants