Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 23 Jun 2017 19:16:56 +0200
From: Jens Gustedt <>
To: Rich Felker <>
Subject: Re: [PATCH 4/8] determine the existence of private futexes
 at the first thread creation

Hello Rich,

On Fri, 23 Jun 2017 13:05:35 -0400 Rich Felker <> wrote:

> On Tue, Jun 20, 2017 at 10:35:28PM +0200, Jens Gustedt wrote:
> > The current strategie to deal with kernels that don't implement
> > private futexes is to
> > 
> >  - test if the call works with FUTEX_PRIVATE
> >  - fallback to a call without if it doesn't
> > 
> > This forces an overhead for both sides, Linux'es with and without
> > private futexes. For those with, it adds a superflouous branch
> > instruction to all calls. For those without, it add the whole call
> > overhead of a syscall.  
> This was intentional, the idea being that a 100% predictable branch in
> a path where a syscall is being made anyway is much less expensive
> than a GOT address load that gets hoisted all the way to the top of
> the function and affects even code paths that don't need to make the
> syscall. Whether it was a choice that makes sense overall, I'm not
> sure, but that was the intent.

Ok, I see. I came to it because I noticed that it might have real
impact on the inline optimization that was e.g suggested for __wake.

Also, as observed while doing this, this mixing of 128 and
FUTEX_PRIVATE in the original code is really disruptive. Not
withstanding that 128 is also the (explicitly used) value of the flag
for mutexes, but that it has exactly the opposite meaning there, its
presence means that the mutex is shared.


:: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536   ::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: ::

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.