This is sources Bugzilla
Bugzilla Version 2.17.5
Bugzilla Bug 6955
  PRIO_INHERIT mutexes do not use FUTEX_PRIVATE_FLAG Last modified: 2008-11-01 19:56
     Query page      Enter new bug
Bug#: 6955   Hardware:   Reporter: Ben Jackson <ben@ben.com>
Host: Target: Build:
Product:     Add CC:
Component:   Version:   CC:
Remove selected CCs
Status: RESOLVED   Priority:  
Resolution: FIXED   Severity:  
Assigned To: Ulrich Drepper <drepper@redhat.com>   Target Milestone:  
Flags: Requestee:
  backport ()
  examined ()
  testsuite ()
Summary:
Keywords:

Attachment Description Type Created Actions
NPTL.DIFF Add FUTEX_PRIVATE_FLAG support for PRIO_INHERIT mutexes patch 2008-10-09 19:20 Edit | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 6955 depends on: Show dependency tree
Show dependency graph
Bug 6955 blocks:

Additional Comments:


Leave as RESOLVED FIXED
Reopen bug
Mark bug as VERIFIED

View Bug Activity   |   Format For Printing


Description:   Last confirmed: 0000-00-00 00:00 Opened: 2008-10-09 19:18
Code in the PRIO_INHERIT cases of pthread_mutex_lock/unlock/trylock/timedlock
call futex() directly with FUTEX_(UN)LOCK_PI regardless of the pshared-ness of
the mutex.  Other cases call futex() indirectly through __lll_*() interfaces
that set FUTEX_PRIVATE_FLAG as appropriate.  This was observed to cause
contention on mm->mmap_sema leading to large, random latencies on otherwise
quick lock operations (apparently due to brk() holding mmap_sema).

I patched nptl to set the private flag in the PRIO_INHERIT cases (based on the
pshared-ness of the mutex) and tested that against the regression tests and my
application.  The tests pass, the application works, and the performance problem
is solved.  However, I am working from a fairly superficial understanding of
this code, and I have not received replies from my inquiries to experts in this
code.

I will try to attach my patch after I submit.  I think it illustrates the
desired behavior, but it may not be exactly what glibc maintainers would want.

------- Additional Comment #1 From Ben Jackson 2008-10-09 19:20 -------
Created an attachment (id=2988)
Add FUTEX_PRIVATE_FLAG support for PRIO_INHERIT mutexes

as described in the original bug report

------- Additional Comment #2 From Ulrich Drepper 2008-11-01 19:56 -------
I've checked in a slightly different, more efficient patch.

     Query page      Enter new bug
Actions: New | Query | bug # | Reports | Requests   New Account | Log In