[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1805061202550.1685@nanos.tec.linutronix.de>
Date: Sun, 6 May 2018 12:03:32 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Peter Zijlstra <peterz@...radead.org>
cc: Daniel Colascione <dancol@...gle.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Paul McKenney <paulmck@...ux.vnet.ibm.com>,
boqun.feng@...il.com, luto@...capital.net, davejwatson@...com,
linux-kernel@...r.kernel.org, linux-api@...r.kernel.org,
Paul Turner <pjt@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux@....linux.org.uk, mingo@...hat.com, hpa@...or.com,
Andrew Hunter <ahh@...gle.com>, andi@...stfloor.org,
cl@...ux.com, bmaurer@...com, rostedt@...dmis.org,
josh@...htriplett.org, torvalds@...ux-foundation.org,
catalin.marinas@....com, will.deacon@....com,
Michael Kerrisk-manpages <mtk.manpages@...il.com>,
Joel Fernandes <joelaf@...gle.com>
Subject: Re: [RFC PATCH for 4.18 00/14] Restartable Sequences
On Wed, 2 May 2018, Peter Zijlstra wrote:
> On Wed, May 02, 2018 at 06:27:22PM +0000, Daniel Colascione wrote:
> > On Wed, May 2, 2018 at 10:22 AM Peter Zijlstra <peterz@...radead.org> wrote:
> > >> On Wed, May 02, 2018 at 03:53:47AM +0000, Daniel Colascione wrote:
> > > > Suppose we make a userspace mutex implemented with a lock word having
> > three
> > > > bits: acquired, sleep_mode, and wait_pending, with the rest of the word
> > not
> > > > being relevant at the moment.
> >
> > > So ideally we'd kill FUTEX_WAIT/FUTEX_WAKE for mutexes entirely, and go
> > > with FUTEX_LOCK/FUTEX_UNLOCK that have the same semantics as the
> > > existing FUTEX_LOCK_PI/FUTEX_UNLOCK_PI, namely, the word contains the
> > > owner TID.
> >
> > That doesn't work if you want to use the rest of the word for something
> > else, like a recursion count. With FUTEX_WAIT and FUTEX_WAKE, you can make
> > a lock with two bits.
>
> Recursive locks are teh most horrible crap ever. And having the tid in
> the word allows things like kernel based optimistic spins and possibly
> PI related things.
FWIW, robust futex have also the TID requirement.
Thanks,
tglx
Powered by blists - more mailing lists