[tip: locking/core] locking/osq: Make osq_link_next() use smp_store_release()
From: tip-bot2 for Peter Zijlstra
Date: Fri Nov 06 2026 - 05:27:11 EST
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 649dd027958996a1101f2187257fe9d65c761b4a
Gitweb: https://git.kernel.org/tip/649dd027958996a1101f2187257fe9d65c761b4a
Author: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
AuthorDate: Wed, 16 Sep 2026 09:54:01 +02:00
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitterDate: Fri, 06 Nov 2026 11:16:24 +01:00
locking/osq: Make osq_link_next() use smp_store_release()
Use smp_store_release() rather than smp_wmb(); this is slightly more
efficient on things like arm64.
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Waiman Long <longman@xxxxxxxxxx>
Cc: David Laight <david.laight.linux@xxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
---
kernel/locking/osq_lock.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/locking/osq_lock.c b/kernel/locking/osq_lock.c
index 2bcc148..984fa11 100644
--- a/kernel/locking/osq_lock.c
+++ b/kernel/locking/osq_lock.c
@@ -129,8 +129,7 @@ static inline void osq_link_next(struct optimistic_spin_node *prev,
*
* Which would result in list corruption.
*/
- smp_wmb();
- WRITE_ONCE(prev->next, next);
+ smp_store_release(&prev->next, next);
}
bool osq_lock(struct optimistic_spin_queue *lock)