From: Thomas Gleixner <tglx@linutronix.de>
To: Stable Team <stable@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Subject: [patch-stable 2/3] rt-mutex: Fix chain walk early wakeup bug
Date: Fri, 08 Jun 2007 10:29:29 -0000 [thread overview]
Message-ID: <20070608101735.088903362@inhelltoy.tec.linutronix.de> (raw)
In-Reply-To: <20070608101714.067427012@inhelltoy.tec.linutronix.de>
[-- Attachment #1: rtmutex-fix-chain-walk.patch --]
[-- Type: text/plain, Size: 1259 bytes --]
Alexey Kuznetsov found some problems in the pi-futex code.
One of the root causes is:
When a wakeup happens, we do not to stop the chain walk so we
we follow a non existing locking chain.
Drop out when this happens.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
---
kernel/rtmutex.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
Index: linux-2.6.21/kernel/rtmutex.c
===================================================================
--- linux-2.6.21.orig/kernel/rtmutex.c 2007-06-08 11:56:10.000000000 +0200
+++ linux-2.6.21/kernel/rtmutex.c 2007-06-08 11:56:10.000000000 +0200
@@ -212,6 +212,19 @@ static int rt_mutex_adjust_prio_chain(st
if (!waiter || !waiter->task)
goto out_unlock_pi;
+ /*
+ * Check the orig_waiter state. After we dropped the locks,
+ * the previous owner of the lock might have released the lock
+ * and made us the pending owner:
+ */
+ if (orig_waiter && !orig_waiter->task)
+ goto out_unlock_pi;
+
+ /*
+ * Drop out, when the task has no waiters. Note,
+ * top_waiter can be NULL, when we are in the deboosting
+ * mode!
+ */
if (top_waiter && (!task_has_pi_waiters(task) ||
top_waiter != task_top_pi_waiter(task)))
goto out_unlock_pi;
--
next prev parent reply other threads:[~2007-06-08 10:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-08 10:29 [patch-stable 0/3] Futex fixes for stable Thomas Gleixner
2007-06-08 10:29 ` [patch-stable 1/3] rt-mutex: Fix stale return value Thomas Gleixner
2007-06-08 10:29 ` Thomas Gleixner [this message]
2007-06-08 10:29 ` [patch-stable 3/3] pi-futex: Fix exit races and locking problems Thomas Gleixner
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=20070608101735.088903362@inhelltoy.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=stable@kernel.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 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®