diff options
| author | Peter Zijlstra <peterz@infradead.org> | 2026-09-15 13:09:33 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2026-11-06 11:16:14 +0100 |
| commit | 1b9e01fcc47aff00d2fd64693c5dcd620eff5865 (patch) | |
| tree | 999018e40020b468e914cb7002505a6cd4c287cd /scripts/dummy-tools/python3 | |
| parent | aa63c0df79920f6abe1b66e1f8b6443ad2d62d0e (diff) | |
locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering
The atomic_cmpxchg() in osq_wait_next() removes the current CPU's node
from the tail of the queue and puts @old_cpu back.
This is very much like an 'unlock', which is RELEASE, rather than
ACQUIRE.
Additionally, on success (the only case where the ordering is
effective), this returns NULL which means both callsites will do nothing
more, there are no subsequent operations to order against.
Furthermore, the osq_lock() caller will then return false, indicating
failure to acquire -- the mutex must go block. Again, not making a case
for ACQUIRE. Neither atomics nor locks provide ordering on failure.
Since ACQUIRE makes no sense, while RELEASE makes it more symmetric with
osq_unlock(), switch the ordering. This then makes osq_unlock()
consistently RELEASE.
Fixes: c55a6ffa6285 ("locking/osq: Relax atomic semantics")
Suggested-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Waiman Long <longman@redhat.com>
Cc: linux-kernel@vger.kernel.org
Diffstat (limited to 'scripts/dummy-tools/python3')
0 files changed, 0 insertions, 0 deletions
