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

From: Sebastian Andrzej Siewior
Date: Mon Jan 15 2024 - 07:16:44 EST


On 2024-01-15 12:52:49 [+0100], Jiri Slaby wrote:

> >
> > The child in fact terminates on
> > https://github.com/apache/apr/blob/trunk/test/testprocmutex.c#L93:
> >                 while ((rv = apr_proc_mutex_timedlock(proc_lock, 1))) {
> >                     if (!APR_STATUS_IS_TIMEUP(rv))
> >                         exit(1); <----- here
> >
> > The test creates 6 children and does some
> > pthread_mutex_timedlock/unlock() repeatedly (200 times) in parallel
> > while sleeping 1 us inside the lock. The timeout is 1 us above. And the
> > test expects all them to fail (to time out). But the time out does not
> > always happen in 6.7 (it's racy, so the failure is semi-random: like 1
> > of 1000 attempts is bad).
>
> This is not precise as I misinterpreted. The test is: either it succeeds or
> times out.
>
> But since the commit, futex() yields 22/EINVAL, i.e. fails.

Let me see if I can reproduce it here…

Sebastian