lkml.org 
[lkml]   [2015]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3 v2] futex: avoid double wake up in futex_wake() on -RT
On Wed, 15 Apr 2015, Davidlohr Bueso wrote:
> On Sun, 2015-04-12 at 20:02 -0700, Davidlohr Bueso wrote:
> > Doing the wakeups while holding the lock is also a general performance
> > issue for futex_wake. The problem being dealing with spurious wakeups
> > (wacky drivers), which makes no difference wrt nr_wake.
>
> So I did some measurements with the patch below (Cc'ing Arnaldo for
> perf-bench consideration, albeit probably still pretty crude) and by
> doing the lockless wakeups, on avg we reduce contending waking threads
> latency in about 2x for each thread, which indicates that overall
> speedup is based on the number of futex_wake'ers.
>
> I guess now we have the code, the numbers. I go back to auditing drivers
> *sigh*. In any case any important core-code already deals with spurious
> wakeups (the last silly offender being sysv sems), so I'm really not
> _that_ concerned -- in fact, Peter, your patch to trigger them seems to
> not trigger any issues anymore. But perhaps its late and I'm in lala
> land.

OTOH, we have quite some other code in the kernel which can generate
spurious wakeups. Just look at signals.

CPU0 CPU1

T1 random_syscall()
schedule_interruptible()

Send process wide signal, wake T1
because its the first target
T2 do_stuff()
handle_signal()
schedule()

T1 Deal with the spurious wakeup

So any code which does not handle a spurious wakeup is broken
independent of the futex changes. So really nothing to worry about.

Thanks,

tglx


\
 
 \ /
  Last update: 2015-04-16 12:01    [W:0.095 / U:1.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site