public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/13234] New: Non-pshared condition variables are ~2-2.5x slower than pshared ones at broadcast
@ 2011-09-28 23:35 bugdal at aerifal dot cx
  2012-04-29  3:02 ` [Bug nptl/13234] " bugdal at aerifal dot cx
  2014-06-27 12:01 ` fweimer at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: bugdal at aerifal dot cx @ 2011-09-28 23:35 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13234

             Bug #: 13234
           Summary: Non-pshared condition variables are ~2-2.5x slower
                    than pshared ones at broadcast
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
        AssignedTo: drepper.fsp@gmail.com
        ReportedBy: bugdal@aerifal.cx
    Classification: Unclassified


Created attachment 5950
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5950
Test program which exhibits performance difference pshared/non-pshared.

The attached program shows NPTL's non-process-shared condition variables (which
utilize futex requeue) performing significantly worse than process-shared ones
(which simply use a broadcast futex wake). On my machine (Atom N280 dual core)
it takes ~11.7 seconds with non-pshared cond var and ~5.3 seconds with a
pshared cond var (comment/uncomment the pthread_cond_init line to change which
is used).

Of course requeue-based broadcast should scale better to huge numbers of
waiters. This test program only has 5 waiters. Still, the performance should
not be this bad. With musl libc, I get comparable performance with pshared and
non-pshared cond var (and both ways outperform NPTL, with run times around
2.5-3 seconds).

If you're unwilling to properly fix whatever's making it slow, perhaps just
using a broadcast futex wake rather than the requeue code whenever the number
of waiters is less than ~10 would be an easy "fix"...

BTW, I suspect the overly-complex sequencing code aimed at minimizing spurious
wakes, which also seems responsible for bugs 12875 and 13165, is probably part
of the problem...

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug nptl/13234] Non-pshared condition variables are ~2-2.5x slower than pshared ones at broadcast
  2011-09-28 23:35 [Bug nptl/13234] New: Non-pshared condition variables are ~2-2.5x slower than pshared ones at broadcast bugdal at aerifal dot cx
@ 2012-04-29  3:02 ` bugdal at aerifal dot cx
  2014-06-27 12:01 ` fweimer at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: bugdal at aerifal dot cx @ 2012-04-29  3:02 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13234

Rich Felker <bugdal at aerifal dot cx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|drepper.fsp at gmail dot    |unassigned at sourceware
                   |com                         |dot org

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug nptl/13234] Non-pshared condition variables are ~2-2.5x slower than pshared ones at broadcast
  2011-09-28 23:35 [Bug nptl/13234] New: Non-pshared condition variables are ~2-2.5x slower than pshared ones at broadcast bugdal at aerifal dot cx
  2012-04-29  3:02 ` [Bug nptl/13234] " bugdal at aerifal dot cx
@ 2014-06-27 12:01 ` fweimer at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: fweimer at redhat dot com @ 2014-06-27 12:01 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=13234

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-27 12:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-28 23:35 [Bug nptl/13234] New: Non-pshared condition variables are ~2-2.5x slower than pshared ones at broadcast bugdal at aerifal dot cx
2012-04-29  3:02 ` [Bug nptl/13234] " bugdal at aerifal dot cx
2014-06-27 12:01 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).