[PATCH v2 3/7] arm64: barrier: enable waiting in smp_cond_load_relaxed_timewait()
From: Ankur Arora
Date: Fri May 02 2025 - 04:55:47 EST
Define __smp_timewait_store() to support waiting in
smp_cond_load_relaxed_timewait(). This uses __cmpwait_relaxed() to
wait in WFE for stores to the target address, with the event-stream
periodically ensuring that we don't wait forever in the failure
case.
In the unlikely case the event-stream is unavailable, the wait_policy
is expected to just fallback to the generic spin-wait implementation.
Cc: Will Deacon <will@xxxxxxxxxx>
Cc: Catalin Marinas <catalin.marinas@xxxxxxx>
Cc: Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx>
Cc: Alexei Starovoitov <ast@xxxxxxxxxx>
Signed-off-by: Ankur Arora <ankur.a.arora@xxxxxxxxxx>
---
arch/arm64/include/asm/barrier.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/include/asm/barrier.h b/arch/arm64/include/asm/barrier.h
index 1ca947d5c939..eaeb78dd48c0 100644
--- a/arch/arm64/include/asm/barrier.h
+++ b/arch/arm64/include/asm/barrier.h
@@ -216,6 +216,9 @@ do { \
(typeof(*ptr))VAL; \
})
+#define __smp_timewait_store(ptr, val) \
+ __cmpwait_relaxed(ptr, val)
+
#include <asm-generic/barrier.h>
#endif /* __ASSEMBLY__ */
--
2.43.5