Re: [PATCH v3 7/7] locking/rtmutex: Acquire the hb lock via trylock after wait-proxylock.

From: Jiri Slaby
Date: Tue Jan 16 2024 - 02:07:34 EST


On 15. 01. 24, 19:33, Sebastian Andrzej Siewior wrote:
This duct tape at the end waits until the pi-state leaves or we get a
waiter. So this works but is not a fix.

FWIW, it indeed avoids the problem.

--- a/kernel/futex/pi.c
+++ b/kernel/futex/pi.c
@@ -1182,6 +1182,9 @@ int futex_unlock_pi(u32 __user *uaddr, unsigned int flags)
rt_waiter = rt_mutex_top_waiter(&pi_state->pi_mutex);
if (!rt_waiter) {
raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock);
+ spin_unlock(&hb->lock);
+ cpu_relax();
+ goto retry;
goto do_uncontended;
}

thanks,
--
js
suse labs