[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Low benchmark performance

Hash: SHA1

Simon Derr wrote:
> Hi,

> My questions are:
> -Is this problem a benchmark-only problem, unlikely to happen in real
> programs ?
> -If not, who is to be blamed ? NPTL, or the kernel ? Maybe just some
> tuning to do.

It might very well happen in real life and it's a kernel issue.

The problem is that the futex wakeup mechanism is too efficient (LT's
was not).  This causes problems since all woken threads are immediately
serialized by the mutex they are required to get before returning from
the wait function [1].  With lots of threads being woken this adds a lot
of pressure to the scheduler, unnecessarily so.

We have already been working on solutions.  It is necessary to have
finer control about the wakeup.  The single FUTEX_WAKEUP operation
doesn't cut it, there have to be more.  I think at least two.  Once they
are implemented and in the kernel we'll have changes for the NPTL code

[1] Don't try to "relax" this situation by using different mutexes even
if this is conceivably possible from your programs semantics.  It's
invalid code, the standard explicitly says so.  Cances are that bad
things will happen with future NPTL versions if you try that.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
Version: GnuPG v1.2.1 (GNU/Linux)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]