RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 605506 - glibc: [RFE] pthread condvars are not priority inheritance aware
Summary: glibc: [RFE] pthread condvars are not priority inheritance aware
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: glibc
Version: 8.2
Hardware: All
OS: All
low
high
Target Milestone: rc
: 8.0
Assignee: glibc team
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-18 06:49 UTC by IBM Bug Proxy
Modified: 2023-07-18 14:30 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-06 14:06:56 UTC
Type: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
IBM Linux Technology Center 65153 0 None None None 2019-07-19 12:05:53 UTC
Red Hat Issue Tracker RHELPLAN-34738 0 None None None 2021-09-17 12:12:12 UTC
Sourceware 11588 0 P2 NEW pthread condvars are not priority inheritance aware 2020-12-23 18:53:55 UTC

Description IBM Bug Proxy 2010-06-18 06:49:47 UTC
=Comment: #0=================================================
Darren V. Hart <dvhltc.com> - 
When using a PTHREAD_PRIO_INHERIT mutex with a condvar, the pthread_cond* calls can still cause an
unbounded priority inversion via the internal condvar lock. The POSIX specification doesn't provide
a mechanism to specify the protocol of the condvar.

We would like to do this at runtime, but unfortunately it is legal to call pthread_cond_signal() or
pthread_cond_broadcast() without first waiting on the lock, so the mutex type may not be known the
first time the condvar is used.

A new API, pthread_condattr_setprotocol_np() and pthread_condattr_getprotocol_np(), would allow the
user to create a PTHREAD_PRIO_INHERIT condvar. This would use a PTHREAD_PRIO_INHERIT mutex for the
internal condvar lock, eliminating the potential for hitting an unbounded priority inversion on that
lock.

This topic was initially discussed here:
http://sources.redhat.com/ml/libc-alpha/2010-01/msg00011.html

And again here:
http://sources.redhat.com/ml/libc-alpha/2010-02/msg00089.html

More details about this bug, including a prototype C implementation including make check glibc
testcases is available on libc-alpha, and is also being tracked on the glibc bugzilla here:

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

Before investing more time in testcases or optimizations, a consensus needs to be had regarding the
proposed API.

Comment 5 Carlos O'Donell 2016-11-25 14:47:49 UTC
We have only just put into Fedora Rawhide a new condvar algorithm written by Torvald Riegel. I'll leave it to Torvald to comment here about priority inheritance and the new algorithm.

One of the real blockers here is the addition of two new symbols to control per-condvar PI properities. We can't add new symbols to RHEL7, therefore this would have to be a RHEL8 feature since there we can expand the API during the major version number transition.

Despite that I'm going to keep this on the RHEL7 track since it's an interesting feature we should review during each update and make sure it carries over to RHEL8.

Comment 6 Torvald Riegel 2016-11-29 14:12:12 UTC
In a nutshell, we do not know how to implement a POSIX-conforming condition variable that is also PI aware using the kernel's futex operations as of today. I have discussed this also with Darren Hart and others at the recent Linux Real-Time Summit, and nobody else had ideas or solutions so far.
Solving this may require new futex operations, or perhaps a completely different condition variable algorithm that trades off other properties important for the general case (eg, good performance) against being able to support PI.

Comment 8 Carlos O'Donell 2019-06-07 02:56:54 UTC
Given that RHEL 8.0 is out I'm moving this RFE there for us to track this as potential upstream work.

Comment 9 Carlos O'Donell 2020-07-06 14:06:56 UTC
We are going to track this bug upstream here:
https://sourceware.org/bugzilla/show_bug.cgi?id=11588

This needs significant discussion upstream with IBM, Intel, and the real-time kernel community.

We need to find a solution that balances the requirements of the general users of a condition variable and those that need priority inheritance.

I'm marking this CLOSED/UPSTREAM, and we can revisit when we have an upstream solution in place.


Note You need to log in before you can comment on or make changes to this bug.