mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Tom Rini <trini@kernel.crashing.org>
Cc: mingo@elte.hu, dwalker@mvista.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RT: Invert some TRACE_BUG_ON_LOCKED tests
Date: Fri, 02 Sep 2005 18:53:56 -0400	[thread overview]
Message-ID: <1125701636.5601.19.camel@localhost.localdomain> (raw)
In-Reply-To: <1125700852.5601.16.camel@localhost.localdomain>

On Fri, 2005-09-02 at 18:40 -0400, Steven Rostedt wrote:
> On Fri, 2005-09-02 at 13:08 -0700, Tom Rini wrote:
> > With 2.6.13-rt4 I had to do the following in order to get my paired down
> > config booting on my x86 whitebox (defconfig works fine, after I enable
> > enet/8250_console/nfsroot).  Daniel Walker helped me trace this down.
> 

> 
> Ingo, I guess we need a TRACE_BUG_ON_LOCKED_SMP() macro.


Tom,

try this patch instead.  It removes the tests of the spin_is_locked on
UP.

-- Steve

Signed-off-by: Steven Rostedt  <rostedt@goodmis.org>

Index: linux_realtime_goliath/kernel/rt.c
===================================================================
--- linux_realtime_goliath/kernel/rt.c	(revision 315)
+++ linux_realtime_goliath/kernel/rt.c	(working copy)
@@ -215,6 +215,16 @@
 		TRACE_BUG_LOCKED();		\
 } while (0)
 
+#ifdef CONFIG_SMP
+# define TRACE_BUG_ON_LOCKED_SMP(c)		\
+do {						\
+	if (unlikely(c))			\
+		TRACE_BUG_LOCKED();		\
+} while (0)
+#else
+# define TRACE_BUG_ON_LOCKED_SMP(c)		do { } while (0)
+#endif
+
 # define trace_local_irq_disable(ti)		raw_local_irq_disable()
 # define trace_local_irq_enable(ti)		raw_local_irq_enable()
 # define trace_local_irq_restore(flags, ti)	raw_local_irq_restore(flags)
@@ -237,6 +247,7 @@
 # define TRACE_WARN_ON_LOCKED(c)		do { } while (0)
 # define TRACE_OFF()				do { } while (0)
 # define TRACE_BUG_ON_LOCKED(c)			do { } while (0)
+# define TRACE_BUG_ON_LOCKED_SMP(c)		do { } while (0)
 
 #endif /* CONFIG_RT_DEADLOCK_DETECT */
 
@@ -736,8 +747,8 @@
 	if (old_owner == new_owner)
 		return;
 
-	TRACE_BUG_ON_LOCKED(!spin_is_locked(&old_owner->task->pi_lock));
-	TRACE_BUG_ON_LOCKED(!spin_is_locked(&new_owner->task->pi_lock));
+	TRACE_BUG_ON_LOCKED_SMP(!spin_is_locked(&old_owner->task->pi_lock));
+	TRACE_BUG_ON_LOCKED_SMP(!spin_is_locked(&new_owner->task->pi_lock));
 	plist_for_each_safe(curr1, next1, &old_owner->task->pi_waiters) {
 		w = plist_entry(curr1, struct rt_mutex_waiter, pi_list);
 		if (w->lock == lock) {
@@ -770,8 +781,8 @@
 		return;
 	}
 
-	TRACE_BUG_ON_LOCKED(!spin_is_locked(&lock->wait_lock));
-	TRACE_BUG_ON_LOCKED(!spin_is_locked(&p->pi_lock));
+	TRACE_BUG_ON_LOCKED_SMP(!spin_is_locked(&lock->wait_lock));
+	TRACE_BUG_ON_LOCKED_SMP(!spin_is_locked(&p->pi_lock));
 #ifdef CONFIG_RT_DEADLOCK_DETECT
 	pi_prio++;
 	if (p->policy != SCHED_NORMAL && prio > normal_prio(p)) {
@@ -967,8 +978,8 @@
 	/*
 	 * Add SCHED_NORMAL tasks to the end of the waitqueue (FIFO):
 	 */
-	TRACE_BUG_ON_LOCKED(!spin_is_locked(&task->pi_lock));
-	TRACE_BUG_ON_LOCKED(!spin_is_locked(&lock->wait_lock));
+	TRACE_BUG_ON_LOCKED_SMP(!spin_is_locked(&task->pi_lock));
+	TRACE_BUG_ON_LOCKED_SMP(!spin_is_locked(&lock->wait_lock));
 #if !ALL_TASKS_PI
 	if (!rt_task(task)) {
 		plist_add(&waiter->list, &lock->wait_list);
@@ -1070,7 +1081,7 @@
 	struct rt_mutex_waiter *waiter = NULL;
 	struct thread_info *new_owner;
 
-	TRACE_BUG_ON_LOCKED(!spin_is_locked(&lock->wait_lock));
+	TRACE_BUG_ON_LOCKED_SMP(!spin_is_locked(&lock->wait_lock));
 	/*
 	 * Get the highest prio one:
 	 *



  reply	other threads:[~2005-09-02 22:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-02 20:00 [PATCH] RT: set LPPTEST default to off Daniel Walker
2005-09-02 20:08 ` [PATCH] RT: Invert some TRACE_BUG_ON_LOCKED tests Tom Rini
2005-09-02 22:40   ` Steven Rostedt
2005-09-02 22:53     ` Steven Rostedt [this message]
2005-09-06 15:16       ` Tom Rini
2005-09-12 13:43   ` Ingo Molnar
2005-09-12 13:47     ` Ingo Molnar

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=1125701636.5601.19.camel@localhost.localdomain \
    --to=rostedt@goodmis.org \
    --cc=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=trini@kernel.crashing.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

Powered by JetHome