mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Esben Nielsen <nielsen.esben@googlemail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Darren Hart <dvhltc@us.ibm.com>,
	Esben Nielsen <nielsen.esben@googlemail.com>,
	Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [-rt] Fix race condition and following BUG in PI-futex
Date: Wed, 2 Aug 2006 00:28:58 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0608020007350.10605@localhost.localdomain> (raw)
In-Reply-To: <1154466456.30391.12.camel@localhost.localdomain>



On Tue, 1 Aug 2006, Steven Rostedt wrote:

> On Tue, 2006-08-01 at 13:22 -0700, Darren Hart wrote:
>
>>>>
>>>>   	list_del_init(&pi_state->owner->pi_state_list);
>>>>   	list_add(&pi_state->list, &new_owner->pi_state_list);
>>>>   	pi_state->owner = new_owner;
>>>> +	atomic_inc(&pi_state->refcount);
>>>
>>> There really needs to be a get_pi_state() or some variant. Having to do
>>> a manual atomic_inc is very dangerous.
>>
>> I understand the need to grab the wait_lock in order to serialize
>> rt_mutex_next_owner(), but why the addition of of the atomic_inc() and the
>> free_pi_state() ?  And if we do need them, shouldn't we place them around the
>> use of the pi_state, rather than just before the unlock calls?
>
> Hmm, is the inc really needed?  The hb->lock is held through this and
> the pi_state can't go away while that lock is held.

I was going to ask about that... If you say so they can go. I just added 
the inc/dec to be sure.

Esben

>
> -- Steve
>
>

  reply	other threads:[~2006-08-01 22:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-01 18:46 Esben Nielsen
2006-08-01 18:23 ` Steven Rostedt
2006-08-01 20:22   ` Darren Hart
2006-08-01 21:07     ` Steven Rostedt
2006-08-01 23:28       ` Esben Nielsen [this message]
2006-08-03  4:48         ` Darren Hart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0608020007350.10605@localhost.localdomain \
    --to=nielsen.esben@googlemail.com \
    --cc=dvhltc@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®