From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org,
linux-rt-users <linux-rt-users@vger.kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Carsten Emde <C.Emde@osadl.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
John Kacur <jkacur@redhat.com>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
<stable-rt@vger.kernel.org>
Subject: [PATCH RT 03/10] rtmutex: Handle non enqueued waiters gracefully
Date: Fri, 26 Feb 2016 16:35:54 -0500 [thread overview]
Message-ID: <20160226213708.554358143@goodmis.org> (raw)
In-Reply-To: 20160226213551.557375746@goodmis.org
[-- Attachment #1: 0003-rtmutex-Handle-non-enqueued-waiters-gracefully.patch --]
[-- Type: text/plain, Size: 1268 bytes --]
3.14.61-rt63-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <tglx@linutronix.de>
Yimin debugged that in case of a PI wakeup in progress when
rt_mutex_start_proxy_lock() calls task_blocks_on_rt_mutex() the latter
returns -EAGAIN and in consequence the remove_waiter() call runs into
a BUG_ON() because there is nothing to remove.
Guard it with rt_mutex_has_waiters(). This is a quick fix which is
easy to backport. The proper fix is to have a central check in
remove_waiter() so we can call it unconditionally.
Reported-and-debugged-by: Yimin Deng <yimin11.deng@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable-rt@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/locking/rtmutex.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
index ee4e7e747e06..2f61c66d6f05 100644
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -2138,7 +2138,7 @@ int rt_mutex_start_proxy_lock(struct rt_mutex *lock,
ret = 0;
}
- if (unlikely(ret))
+ if (ret && rt_mutex_has_waiters(lock))
remove_waiter(lock, waiter);
raw_spin_unlock(&lock->wait_lock);
--
2.7.0
next prev parent reply other threads:[~2016-02-26 21:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-26 21:35 [PATCH RT 00/10] Linux 3.14.61-rt63-rc1 Steven Rostedt
2016-02-26 21:35 ` [PATCH RT 01/10] cpufreq: Remove cpufreq_rwsem Steven Rostedt
2016-02-26 21:35 ` [PATCH RT 02/10] ARM: smp: Move clear_tasks_mm_cpumask() call to __cpu_die() Steven Rostedt
2016-02-26 21:35 ` Steven Rostedt [this message]
2016-02-26 21:35 ` [PATCH RT 04/10] rtmutex: Use chainwalking control enum Steven Rostedt
2016-02-26 21:35 ` [PATCH RT 05/10] dump stack: dont disable preemption during trace Steven Rostedt
2016-02-26 21:35 ` [PATCH RT 06/10] net: Make synchronize_rcu_expedited() conditional on !RT_FULL Steven Rostedt
2016-02-26 21:35 ` [PATCH RT 07/10] net/core/cpuhotplug: Drain input_pkt_queue lockless Steven Rostedt
2016-02-26 21:35 ` [PATCH RT 08/10] irqwork: Move irq safe work to irq context Steven Rostedt
2016-02-26 21:36 ` [PATCH RT 09/10] sched: Introduce the trace_sched_waking tracepoint Steven Rostedt
2016-02-26 21:36 ` [PATCH RT 10/10] Linux 3.14.61-rt63-rc1 Steven Rostedt
-- strict thread matches above, loose matches on Subject: below --
2016-02-26 21:39 [PATCH RT 00/10] Linux 3.12.54-rt73-rc1 Steven Rostedt
2016-02-26 21:39 ` [PATCH RT 03/10] rtmutex: Handle non enqueued waiters gracefully Steven Rostedt
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=20160226213708.554358143@goodmis.org \
--to=rostedt@goodmis.org \
--cc=C.Emde@osadl.org \
--cc=bigeasy@linutronix.de \
--cc=jkacur@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=paul.gortmaker@windriver.com \
--cc=stable-rt@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).