public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-rt-users <linux-rt-users@vger.kernel.org>
Subject: Re: [ANNOUNCE] 3.2.9-rt17
Date: Thu, 08 Mar 2012 21:26:09 +0100	[thread overview]
Message-ID: <1331238369.11248.426.camel@twins> (raw)
In-Reply-To: <1331237441.25686.469.camel@gandalf.stny.rr.com>

On Thu, 2012-03-08 at 15:10 -0500, Steven Rostedt wrote:
> 
> By doing a spin_trydeadlock() while still holding the d_lock, if the
> holder of the i_lock was blocked on that d_lock then it would detect the
> failure, and release the lock and continue the loop. This doesn't solve
> anything. Just because we released the lock, we are still preempting the
> holder of the d_lock

->i_lock, right?

> , and if we are higher in priority, we will never let the owner run.

So, suppose:

task-A				task-B

lock ->i_lock
				lock ->d_lock
lock ->d_lock <blocks>
				trylock ->i_lock

In this case B's trylock will insta-fail (with -EDEADLK) and we unlock
->d_lock in the existing retry logic. That dropping of ->d_lock will
then wake A, but since B is higher prio A we don't actually run A and
B's retry loop will re-acquire ->d_lock.

Crap.. there's also the fact that A doesn't get (or stays) boosted.

I can only think of ugly things to do, like on the deadlock scan, force
assign the first waiter of the inverted lock to owner (in this case the
deadlock is on ->d_lock so assign A), so that the moment we release
->d_lock our re-acquisition fails because its already owned by A, at
that point B will block and boost A.

There's just the little detail of having two owners for a little while..

> But just sleeping a tick sounds like a heuristic that may someday fail.

Oh absolutely agreed, ideally someone would find a way to implement the
-EDEADLK stuff for rt-mutex in a way that doesn't make tglx sad and
actually works.

  reply	other threads:[~2012-03-08 20:26 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-07 21:49 [ANNOUNCE] 3.2.9-rt17 Thomas Gleixner
2012-03-08 18:23 ` Steven Rostedt
2012-03-08 18:28   ` Peter Zijlstra
2012-03-08 18:42     ` Steven Rostedt
2012-03-08 19:39       ` Peter Zijlstra
2012-03-08 20:10         ` Steven Rostedt
2012-03-08 20:26           ` Peter Zijlstra [this message]
2012-03-08 21:08             ` Steven Rostedt
2012-03-08 21:20               ` Peter Zijlstra
2012-03-08 21:25                 ` Steven Rostedt
2012-03-08 21:28                   ` Peter Zijlstra
2012-03-08 21:36                     ` Steven Rostedt
2012-03-08 21:37                       ` Peter Zijlstra
2012-03-08 21:44                         ` Steven Rostedt
2012-03-08 21:54                           ` Peter Zijlstra
2012-03-08 22:13                             ` Steven Rostedt
2012-03-08 22:20                               ` Peter Zijlstra
2012-03-08 22:27                                 ` Steven Rostedt
2012-03-09  4:17                                 ` Steven Rostedt
2012-03-09  0:33                   ` Thomas Gleixner
2012-03-09  3:08                     ` Steven Rostedt
2012-03-09  0:20           ` Thomas Gleixner
2012-03-09  2:50             ` Steven Rostedt
2012-03-09 10:23               ` Thomas Gleixner
2012-03-09 12:51                 ` Steven Rostedt
2012-03-08 19:48       ` Peter Zijlstra
2012-03-08 20:01         ` Steven Rostedt
2012-03-08 20:08           ` Peter Zijlstra

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=1331238369.11248.426.camel@twins \
    --to=peterz@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --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