[tip: locking/core] locking/osq: Remove osq_wait_unlink_next(.node) argument
From: tip-bot2 for Peter Zijlstra
Date: Fri Nov 06 2026 - 05:26:32 EST
The following commit has been merged into the locking/core branch of tip:
Commit-ID: fc5209beeec87d7a5c6a5fc5054041f106f0317c
Gitweb: https://git.kernel.org/tip/fc5209beeec87d7a5c6a5fc5054041f106f0317c
Author: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
AuthorDate: Tue, 15 Sep 2026 13:27:35 +02:00
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitterDate: Fri, 06 Nov 2026 11:16:24 +01:00
locking/osq: Remove osq_wait_unlink_next(.node) argument
In both cases, @node is always this_cpu_ptr(&osq_node), don't
bother passing it along.
No change in functionality intended.
Suggested-by: David Laight <david.laight.linux@xxxxxxxxx>
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: linux-kernel@xxxxxxxxxxxxxxx
---
kernel/locking/osq_lock.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/kernel/locking/osq_lock.c b/kernel/locking/osq_lock.c
index 11d0d34..e3cd066 100644
--- a/kernel/locking/osq_lock.c
+++ b/kernel/locking/osq_lock.c
@@ -46,11 +46,10 @@ static inline struct optimistic_spin_node *decode_cpu(int encoded_cpu_val)
*/
static inline struct optimistic_spin_node *
osq_wait_unlink_next(struct optimistic_spin_queue *lock,
- struct optimistic_spin_node *node,
int old_cpu)
{
+ struct optimistic_spin_node *next, *node = this_cpu_ptr(&osq_node);
int curr = encode_cpu(smp_processor_id());
- struct optimistic_spin_node *next;
for (;;) {
if (atomic_read(&lock->tail) == curr &&
@@ -208,7 +207,7 @@ bool osq_lock(struct optimistic_spin_queue *lock)
* Similar to unlock(), wait for @node->next or move @lock from @node
* back to @prev.
*/
- next_cpu = osq_wait_unlink_next(lock, node, prev_cpu);
+ next_cpu = osq_wait_unlink_next(lock, prev_cpu);
if (next_cpu)
osq_link_next(prev, next_cpu);
@@ -236,5 +235,5 @@ void osq_unlock(struct optimistic_spin_queue *lock)
return;
}
- osq_wait_unlink_next(lock, node, OSQ_UNLOCKED_VAL);
+ osq_wait_unlink_next(lock, OSQ_UNLOCKED_VAL);
}