From: Steven Rostedt <rostedt@goodmis.org>
To: tglx@linutronix.de
Cc: Oleg Nesterov <oleg@tv-sign.ru>, Ingo Molnar <mingo@elte.hu>,
Esben Nielsen <nielsen.esben@googlemail.com>,
linux-kernel@vger.kernel.org
Subject: Re: rt_mutex_timed_lock() vs hrtimer_wakeup() race ?
Date: Tue, 01 Aug 2006 09:21:42 -0400 [thread overview]
Message-ID: <1154438502.25445.19.camel@localhost.localdomain> (raw)
In-Reply-To: <1154436721.5932.60.camel@localhost.localdomain>
On Tue, 2006-08-01 at 14:52 +0200, Thomas Gleixner wrote:
> On Tue, 2006-08-01 at 08:07 -0400, Steven Rostedt wrote:
> > > We hold lock->wait_lock. The owner of this lock can be blocked itself,
> > > which makes it necessary to do the chain walk. The indicator is
> > > owner->pi_blocked_on. This field is only protected by owner->pi_lock.
> > >
> > > If we look at this field outside of owner->pi_lock, then we might miss a
> > > chain walk.
> > >
> >
> > Actually Thomas, not counting the debug case, his patch wont miss a
> > chain walk. That is because the boost is read _after_ the owner's prio
> > is adjusted. So the only thing the lock is doing for us is to prevent
> > us from walking the chain twice for the same lock grab. (btw. I'm
> > looking at 2.6.18-rc2, and not the -rt patch, just to make things
> > clear).
>
> So what do we win, when we drop the lock before we check for boosting ?
> In the worst case we do a redundant chain walk.
>
I'm not saying that it was correct to drop the lock before checking for
boosting. I'm just saying that it won't miss a chain walk. But we might
do two of them. I think I'll send my patch again that fixes this up a
little. I'll make two patches: one for mainline, and one for -rt.
In the debug case, we really don't even need to grab the lock.
(see patch -- coming soon)
-- Steve
prev parent reply other threads:[~2006-08-01 13:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-30 4:36 rt_mutex_timed_lock() vs hrtimer_wakeup() race ? Oleg Nesterov
2006-07-30 22:23 ` Steven Rostedt
2006-08-01 0:12 ` Oleg Nesterov
2006-07-31 20:47 ` Steven Rostedt
2006-08-01 7:58 ` Thomas Gleixner
2006-08-01 12:07 ` Steven Rostedt
2006-08-01 12:52 ` Thomas Gleixner
2006-08-01 13:21 ` Steven Rostedt [this message]
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=1154438502.25445.19.camel@localhost.localdomain \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nielsen.esben@googlemail.com \
--cc=oleg@tv-sign.ru \
--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