[lkml]   [2019]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: WARN_ON_ONCE(!new_owner) within wake_futex_pi() triggered
On Thu, Nov 29, 2018 at 12:23:21PM +0100, Heiko Carstens wrote:

> And indeed, if I run only this test case in an endless loop and do
> some parallel work (like kernel compile) it currently seems to be
> possible to reproduce the warning:
> while true; do time ./ nptl/tst-robustpi8 --direct ; done
> within the build directory of glibc (2.28).

Right; so that reproduces for me.

After staring at all that for a while; trying to remember how it all
worked (or supposed to work rather), I became suspiscous of commit:

56222b212e8e ("futex: Drop hb->lock before enqueueing on the rtmutex")

And indeed, when I revert that; the above reproducer no longer works (as
in, it no longer triggers in minutes and has -- so far -- held up for an
hour+ or so).

That patch in particular allows futex_unlock_pi() to 'start' early:

futex_lock_pi() futex_unlock_pi()
lock hb
lock wait_lock
unlock hb
lock hb
lock wait_lock
rt_mutex_proxy_start // fail
unlock wait_lock
// acquired wait_lock
rt_mutex_next_owner() // whoops, no waiter

lock hb

So reverting that patch should cure things, because then there is no hb
lock break between queue/unqueue and futex_unlock_pi() cannot observe
this half-arsed state.

Now obviously reverting that makes RT unhappy; let me see what the
options are.

(concurrently tglx generated a trace that corroborates)

 \ /
  Last update: 2019-01-28 14:45    [W:0.118 / U:0.996 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site