]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
riscv/futex: Optimize atomic cmpxchg
authorDavidlohr Bueso <dave@stgolabs.net>
Wed, 13 Nov 2024 18:33:21 +0000 (10:33 -0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 11 Dec 2024 15:09:55 +0000 (07:09 -0800)
Remove redundant release/acquire barriers, optimizing the lr/sc sequence
to provide conditional RCsc synchronization, per the RVWMO.

Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Andrea Parri <parri.andrea@gmail.com>
Link: https://lore.kernel.org/r/20241113183321.491113-1-dave@stgolabs.net
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/futex.h

index fc8130f995c1eea886d4b8d886be42e266f50224..72be100afa236bedb7148247b792626a31b6c35b 100644 (file)
@@ -85,7 +85,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
 
        __enable_user_access();
        __asm__ __volatile__ (
-       "1:     lr.w.aqrl %[v],%[u]                     \n"
+       "1:     lr.w %[v],%[u]                          \n"
        "       bne %[v],%z[ov],3f                      \n"
        "2:     sc.w.aqrl %[t],%z[nv],%[u]              \n"
        "       bnez %[t],1b                            \n"