Skip to content

Commit 9d0593d

Browse files
Davidlohr Buesopalmer-dabbelt
authored andcommitted
riscv/futex: Optimize atomic cmpxchg
Remove redundant release/acquire barriers, optimizing the lr/sc sequence to provide conditional RCsc synchronization, per the RVWMO. Signed-off-by: Davidlohr Bueso <[email protected]> Reviewed-by: Andrea Parri <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 0207244 commit 9d0593d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/include/asm/futex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
8585

8686
__enable_user_access();
8787
__asm__ __volatile__ (
88-
"1: lr.w.aqrl %[v],%[u] \n"
88+
"1: lr.w %[v],%[u] \n"
8989
" bne %[v],%z[ov],3f \n"
9090
"2: sc.w.aqrl %[t],%z[nv],%[u] \n"
9191
" bnez %[t],1b \n"

0 commit comments

Comments
 (0)