linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Pthread Condition Variables and Priority Inversion
@ 2012-09-05 23:17 Darren Hart
  2012-09-05 23:59 ` Frank Rowand
  0 siblings, 1 reply; 6+ messages in thread
From: Darren Hart @ 2012-09-05 23:17 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: Frank Rowand, Thomas Gleixner, linux-rt-users, Jan Kiszka

Hi Michael,

I've tried many times over the last several years to get proper priority
inheritance support for pthread condition variables added to glibc.
Unfortunately, I haven't convinced the powers that be to incorporate the
proposed fixes. Since the failure scenario involves an opaque type and
is rather non-intuitive, it was suggested (thanks Frank) that I attempt
to at least document the behavior. The goal is to discourage the use of
condition variables in real-time applications as they have the potential
for catastrophic system failure which could lead to loss of life - at
least until such time as support is incorporated into the C library.

I understand PTHREAD_COND_TIMEDWAIT(3P) is not Linux specific. I wonder
if you could recommend an appropriate document for the following blurb:

While the Linux kernel, since 2.6.31, supports requeueing of
priority-inheritance (PI) aware mutexes via the FUTEX_WAIT_REQUEUE_PI
and FUTEX_CMP_REQUEUE_PI futex operations, the glibc implementation does
not yet take full advantage of this. Specifically, the condvar internal
data lock remains a non-PI aware mutex, regardless of the type of the
pthread_mutex associated with the condvar. This can lead to an unbounded
priority inversion on the internal data lock even when associating a PI
aware pthread_mutex with a condvar during a pthread_cond*_wait
operation. For this reason, it is not recommended to rely on priority
inheritance when using pthread condition variables.

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Technical Lead - Linux Kernel

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

* Re: Pthread Condition Variables and Priority Inversion
  2012-09-05 23:17 Pthread Condition Variables and Priority Inversion Darren Hart
@ 2012-09-05 23:59 ` Frank Rowand
  2012-09-06  0:10   ` Darren Hart
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Rowand @ 2012-09-05 23:59 UTC (permalink / raw)
  To: Darren Hart; +Cc: Thomas Gleixner, linux-rt-users

On 09/05/12 16:17, Darren Hart wrote:
> Hi Michael,
> 
> I've tried many times over the last several years to get proper priority
> inheritance support for pthread condition variables added to glibc.
> Unfortunately, I haven't convinced the powers that be to incorporate the
> proposed fixes. Since the failure scenario involves an opaque type and
> is rather non-intuitive, it was suggested (thanks Frank) that I attempt
> to at least document the behavior.

< snip >

That reminds me...  someone at Plumbers (I'm pretty sure it was Thomas)
told me that the glibc maintainers have become much more responsive,
so maybe I should encourage you to try once again, when you find some
spare time :-), submitting to glibc.

-Frank


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

* Re: Pthread Condition Variables and Priority Inversion
  2012-09-05 23:59 ` Frank Rowand
@ 2012-09-06  0:10   ` Darren Hart
  2012-09-14  2:16     ` Carol Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Darren Hart @ 2012-09-06  0:10 UTC (permalink / raw)
  To: frank.rowand; +Cc: Thomas Gleixner, linux-rt-users



On 09/05/2012 04:59 PM, Frank Rowand wrote:
> On 09/05/12 16:17, Darren Hart wrote:
>> Hi Michael,
>>
>> I've tried many times over the last several years to get proper priority
>> inheritance support for pthread condition variables added to glibc.
>> Unfortunately, I haven't convinced the powers that be to incorporate the
>> proposed fixes. Since the failure scenario involves an opaque type and
>> is rather non-intuitive, it was suggested (thanks Frank) that I attempt
>> to at least document the behavior.
> 
> < snip >
> 
> That reminds me...  someone at Plumbers (I'm pretty sure it was Thomas)
> told me that the glibc maintainers have become much more responsive,
> so maybe I should encourage you to try once again, when you find some
> spare time :-), submitting to glibc.

I think Jan and I both intend to do this, but until such time as we can,
I'd like the docs to reflect reality.

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Technical Lead - Linux Kernel

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

* RE: Pthread Condition Variables and Priority Inversion
  2012-09-06  0:10   ` Darren Hart
@ 2012-09-14  2:16     ` Carol Wong
  2012-09-14 17:10       ` Jan Kiszka
  0 siblings, 1 reply; 6+ messages in thread
From: Carol Wong @ 2012-09-14  2:16 UTC (permalink / raw)
  To: Darren Hart, frank.rowand@am.sony.com; +Cc: Thomas Gleixner, linux-rt-users

<snip>

> >
> > That reminds me...  someone at Plumbers (I'm pretty sure it was
> Thomas)
> > told me that the glibc maintainers have become much more responsive,
> > so maybe I should encourage you to try once again, when you find some
> > spare time :-), submitting to glibc.
> 
> I think Jan and I both intend to do this, but until such time as we can,
> I'd like the docs to reflect reality.
> 
> --
> Darren Hart
> Intel Open Source Technology Center
> Yocto Project - Technical Lead - Linux Kernel

We've run up against this condvar limitation on the system (glibc 2.15 on Linux with RT patch) we've been developing.

How can we help nudge the glibc maintainers? Is there some issue/fix voting system?

Cheers,
Carol
NetAcquire Corporation

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

* Re: Pthread Condition Variables and Priority Inversion
  2012-09-14  2:16     ` Carol Wong
@ 2012-09-14 17:10       ` Jan Kiszka
  2012-09-14 19:28         ` Darren Hart
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2012-09-14 17:10 UTC (permalink / raw)
  To: Carol Wong
  Cc: Darren Hart, frank.rowand@am.sony.com, Thomas Gleixner,
	linux-rt-users

On 2012-09-14 04:16, Carol Wong wrote:
> <snip>
> 
>>>
>>> That reminds me...  someone at Plumbers (I'm pretty sure it was
>> Thomas)
>>> told me that the glibc maintainers have become much more responsive,
>>> so maybe I should encourage you to try once again, when you find some
>>> spare time :-), submitting to glibc.
>>
>> I think Jan and I both intend to do this, but until such time as we can,
>> I'd like the docs to reflect reality.
>>
>> --
>> Darren Hart
>> Intel Open Source Technology Center
>> Yocto Project - Technical Lead - Linux Kernel
> 
> We've run up against this condvar limitation on the system (glibc 2.15 on Linux with RT patch) we've been developing.
> 
> How can we help nudge the glibc maintainers? Is there some issue/fix voting system?

Well, at least this one is not working properly yet:

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

Does someone have personal contact to a key persons from the community
and can raise the awareness level there?

Jan

-- 
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux

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

* Re: Pthread Condition Variables and Priority Inversion
  2012-09-14 17:10       ` Jan Kiszka
@ 2012-09-14 19:28         ` Darren Hart
  0 siblings, 0 replies; 6+ messages in thread
From: Darren Hart @ 2012-09-14 19:28 UTC (permalink / raw)
  To: Jan Kiszka
  Cc: Carol Wong, frank.rowand@am.sony.com, Thomas Gleixner,
	linux-rt-users



On 09/14/2012 10:10 AM, Jan Kiszka wrote:
> On 2012-09-14 04:16, Carol Wong wrote:
>> <snip>
>>
>>>>
>>>> That reminds me...  someone at Plumbers (I'm pretty sure it was
>>> Thomas)
>>>> told me that the glibc maintainers have become much more responsive,
>>>> so maybe I should encourage you to try once again, when you find some
>>>> spare time :-), submitting to glibc.
>>>
>>> I think Jan and I both intend to do this, but until such time as we can,
>>> I'd like the docs to reflect reality.
>>>
>>> --
>>> Darren Hart
>>> Intel Open Source Technology Center
>>> Yocto Project - Technical Lead - Linux Kernel
>>
>> We've run up against this condvar limitation on the system (glibc 2.15 on Linux with RT patch) we've been developing.
>>
>> How can we help nudge the glibc maintainers? Is there some issue/fix voting system?
> 
> Well, at least this one is not working properly yet:
> 
> http://sourceware.org/bugzilla/show_bug.cgi?id=11588
> 
> Does someone have personal contact to a key persons from the community
> and can raise the awareness level there?

This bug has all the context, so this is definitely the place to focus.
As for nudging people along in the right direction, I've tried appealing
to Mark Brown and the POSIX committee without success. I suppose we
could go back and review whatever changes were to the glibc development
processes and email the relevant individuals.


-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Technical Lead - Linux Kernel

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

end of thread, other threads:[~2012-09-14 19:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-05 23:17 Pthread Condition Variables and Priority Inversion Darren Hart
2012-09-05 23:59 ` Frank Rowand
2012-09-06  0:10   ` Darren Hart
2012-09-14  2:16     ` Carol Wong
2012-09-14 17:10       ` Jan Kiszka
2012-09-14 19:28         ` Darren Hart

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 NNTP newsgroup(s).