[PATCH v2 3/7] arm64: barrier: enable waiting in smp_cond_load_relaxed_timewait()

Ankur Arora ankur.a.arora at oracle.com
Fri May 2 01:52:19 PDT 2025


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 at kernel.org>
Cc: Catalin Marinas <catalin.marinas at arm.com>
Cc: Kumar Kartikeya Dwivedi <memxor at gmail.com>
Cc: Alexei Starovoitov <ast at kernel.org>
Signed-off-by: Ankur Arora <ankur.a.arora at oracle.com>
---
 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




More information about the linux-arm-kernel mailing list