Re: [PATCH 5/5] locking/ww_mutex/test: Time an ABBA with both owners running
From: Mathieu Desnoyers
Date: Fri Nov 06 2026 - 19:28:03 EST
On 2026-11-06 19:11, sashiko-bot@xxxxxxxxxx wrote:
Can abba_spin_young() obtain a smaller ctx.stamp than abba_spin_old() on[...]
weakly-ordered architectures?
Using atomic_set_release() and atomic_read_acquire() on s->stage would
order the stamp allocations.
Right. ww_acquire_init() takes the stamp with a relaxed increment, and
nothing orders it before the relaxed store of stage 1: on a
weakly-ordered CPU the younger thread can take the older stamp, wound
the other one, and the test fails with -EDEADLK where nothing is wrong.
x86 does not reorder them. v2 makes each stage store a release and the
poll an acquire.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com