All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	linux-rt-users <linux-rt-users@vger.kernel.org>,
	Carsten Emde <C.Emde@osadl.org>,
	Mike Galbraith <umgwanakikbuti@gmail.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Clark Williams <williams@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [RFC PATCH RT V4] rwsem: The return of multi-reader PI rwsems
Date: Fri, 18 Apr 2014 10:19:26 +0200	[thread overview]
Message-ID: <20140418081926.GC14560@gmail.com> (raw)
In-Reply-To: <20140417192603.6e379157@gandalf.local.home>


* Steven Rostedt <rostedt@goodmis.org> wrote:

> Changes since v3:
> 
> Clark reported that he was seeing a large latency when he added this
> patch. I tested it out on a 8 logical CPU box, and sure enough I was
> seeing it too. After spending the day debugging why, I found that I had
> a bug in rt_mutex_getprio(), where I could do:
> 
>   min(task_top_pi_waiter(task)->pi_list_entry.prio, prio)
> 
> when there was no "top_pi_waiter", which would give garbage as a
> result. This would let some tasks have higher priority than they
> should, and cause other tasks that should have high priority not run.

Would a sanity check like the one below have helped? (untested and 
such)

Thanks,

	Ingo

==========>
 kernel/locking/rtmutex_common.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h
index 7431a9c..36b1ce8 100644
--- a/kernel/locking/rtmutex_common.h
+++ b/kernel/locking/rtmutex_common.h
@@ -85,6 +85,7 @@ static inline int task_has_pi_waiters(struct task_struct *p)
 static inline struct rt_mutex_waiter *
 task_top_pi_waiter(struct task_struct *p)
 {
+	WARN_ON_ONCE(!p->pi_waiters_leftmost);
 	return rb_entry(p->pi_waiters_leftmost, struct rt_mutex_waiter,
 			pi_tree_entry);
 }

  reply	other threads:[~2014-04-18  8:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-09 19:19 [RFC PATCH RT] rwsem: The return of multi-reader PI rwsems Steven Rostedt
2014-04-10 14:18 ` Mike Galbraith
2014-04-10 14:28   ` Mike Galbraith
2014-04-10 14:32     ` Steven Rostedt
2014-04-11  2:50     ` Mike Galbraith
2014-04-11  3:25       ` Steven Rostedt
2014-04-11  3:52         ` Mike Galbraith
2014-04-11  4:25           ` Mike Galbraith
2014-04-10 14:44 ` Clark Williams
2014-04-10 15:01   ` Steven Rostedt
2014-04-10 15:03   ` Sebastian Andrzej Siewior
2014-04-10 15:36     ` Peter Zijlstra
2014-04-10 19:17       ` Steven Rostedt
2014-04-10 20:48         ` Peter Zijlstra
2014-04-10 21:30         ` Paul E. McKenney
2014-04-10 22:02           ` Steven Rostedt
2014-04-10 15:38     ` Steven Rostedt
2014-04-11 21:39   ` Daniel Bristot de Oliveira
2014-04-10 17:42 ` [RFC PATCH RT V2] " Steven Rostedt
2014-04-11  2:35   ` [RFC PATCH RT V3] " Steven Rostedt
2014-04-11 12:47     ` Carsten Emde
2014-04-11 13:25       ` Steven Rostedt
2014-04-17 23:26         ` [RFC PATCH RT V4] " Steven Rostedt
2014-04-18  8:19           ` Ingo Molnar [this message]
2014-04-24 17:52             ` Steven Rostedt
2014-04-14  9:55 ` [RFC PATCH RT] " Ingo Molnar
2014-04-14 13:34   ` Steven Rostedt
2014-04-14 14: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=20140418081926.GC14560@gmail.com \
    --to=mingo@kernel.org \
    --cc=C.Emde@osadl.org \
    --cc=bigeasy@linutronix.de \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=umgwanakikbuti@gmail.com \
    --cc=williams@redhat.com \
    /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.