All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Darren Hart <dvhart@linux.intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Maarten Lankhorst <m.b.lankhorst@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: rt_mutex: restore wait_lock init in __rt_mutex_init
Date: Wed, 27 Jul 2011 11:37:24 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.02.1107271130280.2660@ionos> (raw)
In-Reply-To: <1311754711-19577-1-git-send-email-dvhart@linux.intel.com>

On Wed, 27 Jul 2011, Darren Hart wrote:

> Without the raw_spin_lock_init(), the wait_lock does not get properly
> initialized with CONFIG_DEBUG_SPINLOCK. This can manifest in a BUG() in the
> futex requeue_pi path when the pi_state->pi_mutex->wait_lock fails the magic
> test in rt_mutex_start_proxy_lock()->raw_spin_lock(&lock->wait_lock).

That's actively wrong. You reinitialize the lock for all other cases
which call this via rt_mutex_init(). There is a reason why I moved the
spin lock initializer out of __rt_mutex_init() into
rt_mutex_init(). The lock name stuff for lockdep ends up to be
"lock->wait_lock" for all rt_mutexes, which is pretty useless when you
have to analyze a lockdep splat. Thanks for finding it nevertheless.

So the correct fix is:

Index: linux-2.6/kernel/rtmutex.c
===================================================================
--- linux-2.6.orig/kernel/rtmutex.c
+++ linux-2.6/kernel/rtmutex.c
@@ -1296,7 +1296,7 @@ EXPORT_SYMBOL_GPL(__rt_mutex_init);
 void rt_mutex_init_proxy_locked(struct rt_mutex *lock,
 				struct task_struct *proxy_owner)
 {
-	__rt_mutex_init(lock, NULL);
+	rt_mutex_init(lock);
 	debug_rt_mutex_proxy_lock(lock, proxy_owner);
 	rt_mutex_set_owner(lock, proxy_owner);
 	rt_mutex_deadlock_account_lock(lock, proxy_owner);

 

  reply	other threads:[~2011-07-27  9:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-27  8:18 rt_mutex: restore wait_lock init in __rt_mutex_init Darren Hart
2011-07-27  9:37 ` Thomas Gleixner [this message]
2011-07-27 14:34   ` Maarten Lankhorst
2011-07-27 15:43     ` 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=alpine.LFD.2.02.1107271130280.2660@ionos \
    --to=tglx@linutronix.de \
    --cc=dvhart@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.b.lankhorst@gmail.com \
    --cc=rostedt@goodmis.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.