diff options
author | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2025-03-16 07:05:25 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2025-03-19 18:03:05 +0300 |
commit | 337ffea51aeec0b2212d862383a04088e5c063f7 (patch) | |
tree | ef58762c4355e9daabb4ac266499f937cbb4c00b /scripts/lib/abi/helpers.py | |
parent | ebababcd03729db14b2dd911d6600af84415509c (diff) | |
download | linux-337ffea51aeec0b2212d862383a04088e5c063f7.tar.xz |
rqspinlock: Protect pending bit owners from stalls
The pending bit is used to avoid queueing in case the lock is
uncontended, and has demonstrated benefits for the 2 contender scenario,
esp. on x86. In case the pending bit is acquired and we wait for the
locked bit to disappear, we may get stuck due to the lock owner not
making progress. Hence, this waiting loop must be protected with a
timeout check.
To perform a graceful recovery once we decide to abort our lock
acquisition attempt in this case, we must unset the pending bit since we
own it. All waiters undoing their changes and exiting gracefully allows
the lock word to be restored to the unlocked state once all participants
(owner, waiters) have been recovered, and the lock remains usable.
Hence, set the pending bit back to zero before returning to the caller.
Introduce a lockevent (rqspinlock_lock_timeout) to capture timeout
event statistics.
Reviewed-by: Barret Rhoden <brho@google.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20250316040541.108729-10-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'scripts/lib/abi/helpers.py')
0 files changed, 0 insertions, 0 deletions