Skip to content

Adding 'sb' instruction to fastlock_lock() for ARM v8.5 onward #911

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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. In general, ISB instruction has lower cost for the CPU than"YIELD" on ARM64. Moreover, 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?

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.

1 participant