Re: [PATCH -v5 09/14] futex: Rework inconsistent rt_mutex/futex_q state
From: Thomas Gleixner
Date: Tue Mar 07 2017 - 09:46:37 EST
On Sat, 4 Mar 2017, Peter Zijlstra wrote:
> @@ -1402,12 +1402,18 @@ static int wake_futex_pi(u32 __user *uad
> new_owner = rt_mutex_next_owner(&pi_state->pi_mutex);
>
> /*
> - * It is possible that the next waiter (the one that brought
> - * top_waiter owner to the kernel) timed out and is no longer
> - * waiting on the lock.
> + * When we interleave with futex_lock_pi() where it does
> + * rt_mutex_timed_futex_lock(), we might observe @this futex_q waiter,
> + * but the rt_mutex's wait_list can be empty (either still, or again,
> + * depending on which side we land).
> + *
> + * When this happens, give up our locks and try again, giving the
> + * futex_lock_pi() instance time to complete and unqueue_me().
time to complete, either by waiting on the rtmutex or removing itself
from the futex queue.
Or something like that.
Thanks,
tglx