locking/atomic/x86: Introduce arch_atomic64_read_nonatomic() to x86_32
authorUros Bizjak <ubizjak@gmail.com>
Wed, 10 Apr 2024 06:29:34 +0000 (08:29 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 10 Apr 2024 13:04:54 +0000 (15:04 +0200)
commite73c4e34a0e9e3dfcb4e5ee4ccd3039a7b603218
treea760c0320424e5387a89e4b42ccaa15c9e0447ad
parent276b893049e4cdc2f33c009706a75ec18a114485
locking/atomic/x86: Introduce arch_atomic64_read_nonatomic() to x86_32

Introduce arch_atomic64_read_nonatomic() for 32-bit targets to load
the value from atomic64_t location in a non-atomic way. This
function is intended to be used in cases where a subsequent atomic
operation will handle the torn value, and can be used to prime the
first iteration of unconditional try_cmpxchg() loops.

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20240410062957.322614-2-ubizjak@gmail.com
arch/x86/include/asm/atomic64_32.h