Re: [PATCH V2 0/6][RFC] futex: FUTEX_LOCK with optional adaptive spinning

From: drepper
Date: Thu Apr 08 2010 - 00:29:47 EST


On Wed, Apr 7, 2010 at 20:41, Darren Hart <dvhltc@xxxxxxxxxx> wrote:
For general futexes sure, but not for robust or PI mutexes. Having adaptive
futexes be based on the TID|WAITERS_FLAG policy certainly isn't breaking new
ground, and is consistent with the other kernel-side futex locking
implementations.

PI mutexes are really unimportant in the big world. I know your employer cares but overall it's a minute fraction. The focus should be primarily on the normal futexes.

BTW, you want to stuff a flag in the futex word? This doesn't work in general. For a mutex we need three distinct value. For PI futexes it's 0, TID and -TID. If we have 31 bit TID values there isn't enough room for another bit.


What about the concern of this TLS approach only working for process private
locks? I would very much like to make this work for both shared and private
locks.

Again, hardly a general concern. It's a minute fraction of mutexes which is shared.

It should be clear that the kernel approach and the userlevel approach are complimentary and could even be used. If the userlevel variant proves significantly faster (and I assume it will) then the kernel variant could be used for shared mutexes etc.

Attachment: signature.asc
Description: OpenPGP digital signature