LoongArch: Document that byte and short atomics are implemented with LL/SC
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 6 Sep 2023 13:25:22 +0000 (09:25 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 6 Sep 2023 13:29:32 +0000 (09:29 -0400)
Based on the LoongArch Reference Manual:

https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html

Section 2.2.7 "Atomic Memory Access Instructions" only lists atomic
operations for 32-bit and 64-bit integers. As detailed in Section
2.2.7.1, LL/SC instructions operating on 32-bit and 64-bit integers are
also available. Those are used by the compiler to support atomics on
byte and short types.

This means atomics on 32-bit and 64-bit types have stronger forward
progress guarantees than those operating on 8-bit and 16-bit types.

Link: https://github.com/urcu/userspace-rcu/pull/11#issuecomment-1706528796
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I01569b718f7300a46d984c34065c0bbfbd2f7cc6

include/urcu/uatomic/loongarch.h

index f41302a274920dd2534756727880ddf0905f3821..dcf9e935fd44f229819b2128d25944aa26363491 100644 (file)
 extern "C" {
 #endif
 
+/*
+ * LoongArch implements byte and short atomics with LL/SC instructions,
+ * which retry if the cache line is modified concurrently between LL and
+ * SC.
+ */
 #define UATOMIC_HAS_ATOMIC_BYTE
 #define UATOMIC_HAS_ATOMIC_SHORT
 
This page took 0.025869 seconds and 4 git commands to generate.