commit | 713580c1e2a4a5b479bbe5095d8930326e6ba3d3 | [log] [tgz] |
---|---|---|
author | David Brazdil <dbrazdil@google.com> | Tue Sep 17 16:16:51 2019 +0100 |
committer | David Brazdil <dbrazdil@google.com> | Fri Sep 20 15:19:43 2019 +0000 |
tree | f43801a989282c05f872ff0aadcdc3f6064c9757 | |
parent | c377107726cdbfffd6fd07c7164e010b300761d5 [diff] |
Improve spinlock implementation for ARMv8.0 Current implementation of spinlocks using C11 atomics compiles into an LDAXR/STXR pair which we observe does not always make forward progress on Cortex A72 (concurrent_save_restore test livelocks). This patch inserts a WFE instruction when the LDAXR returns that the lock is currently taken, pausing the thread until an event is triggered and easing off the contention. This is observed to help forward progress on A72 and should also improve power consumption of our spinlocks. Note that there is still no guarantee of forward progress and threads can be shown to livelock on the A72 if the loops are extremely tight. This should be revisited in the future, possibly by leveraging ARMv8.1 LSE atomics. Test: vcpu_state.concurrent_save_restore Bug: 141087046 Change-Id: Ic838ba4d287ef4bfecc7dd84c883770d9c445b1d
Hafnium is a hypervisor, initially supporting aarch64 (64-bit ARMv8 CPUs).
Get in touch and keep up-to-date at hafnium-discuss@googlegroups.com.
To jump in and build Hafnium, follow the getting started instructions.
If you want to contribute to the project, see details of how we accept contributions.
More documentation is available on: