[PATCH 0/6] locking/atomic/x86: Improve arch_atomic*() family of functions

From: Uros Bizjak
Date: Tue Apr 09 2024 - 06:05:56 EST


The following patch series improves x86 arch_atomic*()
family of functions and merges x86_32 and x86_64
arch_atomic64_fetch_{and,or,xor}() functions.

The patch series enables impressive assembly code
reductions for x86_32 target and lowers future maintenace
burden and technical debt of the source code by unifying
several functions between x86_32 and x86_32 targets.

Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxxxx>
Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>

Uros Bizjak (6):
locking/atomic/x86: Introduce arch_atomic64_try_cmpxchg to x86_32
locking/atomic/x86: Rewrite x86_32
arch_atomic64_{,fetch}_{and,or,xor}() functions
locking/atomic/x86: Use READ_ONCE before atomic{,64}_try_cmpxchg loops
locking/atomic/x86: Merge x86_32 and x86_64
arch_atomic64_fetch_{and,or,xor}() functions
locking/atomic/x86: Define arch_atomic_sub() family using
arch_atomic_add() functions
locking/atomic/x86: Reorder a couple of arch_atomic64 functions

arch/x86/include/asm/atomic.h | 50 ++++++++++----
arch/x86/include/asm/atomic64_32.h | 103 ++++++++++-------------------
arch/x86/include/asm/atomic64_64.h | 44 +-----------
3 files changed, 75 insertions(+), 122 deletions(-)

--
2.44.0