Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-30
STALE3722d

[PATCH v2] arm64: barrier: implement wfe-based smp_cond_load_acquire

From: peterz@infradead.org (Peter Zijlstra)
Date: 2016-06-30 13:10:15

On Thu, Jun 30, 2016 at 02:00:17PM +0100, Will Deacon wrote:
On Mon, Jun 27, 2016 at 06:43:54PM +0100, Will Deacon wrote:
quoted
smp_cond_load_acquire is used to spin on a variable until some
expression involving that variable becomes true.

On arm64, we can build this using WFE and LDXR, since clearing of the
exclusive monitor as a result of the variable being changed by another
CPU generates an event, which will wake us up out of WFE.

This patch implements smp_cond_load_acquire using LDXR and WFE, which
themselves are contained in an internal __cmpwait function.

Signed-off-by: Will Deacon <redacted>
---

Based on Peter's locking/core branch.

v1->v2: Use cmpwait_relaxed

 arch/arm64/include/asm/barrier.h | 13 ++++++++++
 arch/arm64/include/asm/cmpxchg.h | 51 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 64 insertions(+)
Peter -- could you take this one via locking/core for 4.8, please? I don't
anticipate any conflicts with the arm64 tree and it relies on your other
cond-wait patches anyway.
OK, queued it. Thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help