All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RT: set LPPTEST default to off
@ 2005-09-02 20:00 Daniel Walker
  2005-09-02 20:08 ` [PATCH] RT: Invert some TRACE_BUG_ON_LOCKED tests Tom Rini
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Walker @ 2005-09-02 20:00 UTC (permalink / raw)
  To: mingo; +Cc: trini, linux-kernel


Set the default to off for the LPP test. Since it's not usually going
to be used.

Signed-Off-By: Daniel Walker <dwalker@mvista.com>

Index: linux-2.6.13/drivers/char/Kconfig
===================================================================
--- linux-2.6.13.orig/drivers/char/Kconfig	2005-09-01 21:25:52.000000000 +0000
+++ linux-2.6.13/drivers/char/Kconfig	2005-09-02 16:06:59.000000000 +0000
@@ -730,7 +730,7 @@ config BLOCKER
 config LPPTEST
 	tristate "Parallel Port Based Latency Measurement Device"
 	depends on !PARPORT
-	default y
+	default n 
 	---help---
 	  If you say Y here then a device will be created that the userspace
 	  testlpp utility uses to measure IRQ latencies of a target system




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] RT: Invert some TRACE_BUG_ON_LOCKED tests
  2005-09-02 20:00 [PATCH] RT: set LPPTEST default to off Daniel Walker
@ 2005-09-02 20:08 ` Tom Rini
  2005-09-02 22:40   ` Steven Rostedt
  2005-09-12 13:43   ` Ingo Molnar
  0 siblings, 2 replies; 7+ messages in thread
From: Tom Rini @ 2005-09-02 20:08 UTC (permalink / raw)
  To: mingo; +Cc: dwalker, linux-kernel

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.

Signed-off-by: Tom Rini <trini@kernel.crashing.org>

--- linux-2.6.13/kernel/rt.c	2005-09-02 12:39:02.000000000 -0700
+++ linux-2.6.13/kernel/rt.c	2005-09-02 12:24:04.000000000 -0700
@@ -736,8 +736,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(spin_is_locked(&old_owner->task->pi_lock));
+	TRACE_BUG_ON_LOCKED(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 +770,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(spin_is_locked(&lock->wait_lock));
+	TRACE_BUG_ON_LOCKED(spin_is_locked(&p->pi_lock));
 #ifdef CONFIG_RT_DEADLOCK_DETECT
 	pi_prio++;
 	if (p->policy != SCHED_NORMAL && prio > normal_prio(p)) {
@@ -967,8 +967,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(spin_is_locked(&task->pi_lock));
+	TRACE_BUG_ON_LOCKED(spin_is_locked(&lock->wait_lock));
 #if !ALL_TASKS_PI
 	if (!rt_task(task)) {
 		plist_add(&waiter->list, &lock->wait_list);
@@ -1070,7 +1070,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(spin_is_locked(&lock->wait_lock));
 	/*
 	 * Get the highest prio one:
 	 *

-- 
Tom Rini
http://gate.crashing.org/~trini/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] RT: Invert some TRACE_BUG_ON_LOCKED tests
  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
  2005-09-12 13:43   ` Ingo Molnar
  1 sibling, 1 reply; 7+ messages in thread
From: Steven Rostedt @ 2005-09-02 22:40 UTC (permalink / raw)
  To: Tom Rini; +Cc: linux-kernel, dwalker, mingo

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.


Tom,

TRACE_BUG_ON_LOCKED(!spin_is_locked(&lock->wait_lock));

_is_ correct.  Those locks must be locked at those cases.  If it isn't
then we wan't to trigger a bug.  Hence the "BUG_ON" part.  You can never
guarantee that a lock will be unlock since another process on another
CPU might have it.

Now if you are getting a BUG, where as one of these places the lock is
_not_ held, then that's a bug.

Hmm, I wonder if these should be switched to __raw_spin_is_locked.

Oh wait, is this a UP system?  Shoot, spin_is_locked on UP is defined as
zero so this _would_ trigger. Ouch!

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

-- Steve




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] RT: Invert some TRACE_BUG_ON_LOCKED tests
  2005-09-02 22:40   ` Steven Rostedt
@ 2005-09-02 22:53     ` Steven Rostedt
  2005-09-06 15:16       ` Tom Rini
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Rostedt @ 2005-09-02 22:53 UTC (permalink / raw)
  To: Tom Rini; +Cc: mingo, dwalker, linux-kernel

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:
 	 *



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] RT: Invert some TRACE_BUG_ON_LOCKED tests
  2005-09-02 22:53     ` Steven Rostedt
@ 2005-09-06 15:16       ` Tom Rini
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2005-09-06 15:16 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: mingo, dwalker, linux-kernel

On Fri, Sep 02, 2005 at 06:53:56PM -0400, Steven Rostedt wrote:
> 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.

This of course works too, thanks!

-- 
Tom Rini
http://gate.crashing.org/~trini/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] RT: Invert some TRACE_BUG_ON_LOCKED tests
  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-12 13:43   ` Ingo Molnar
  2005-09-12 13:47     ` Ingo Molnar
  1 sibling, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2005-09-12 13:43 UTC (permalink / raw)
  To: Tom Rini; +Cc: dwalker, linux-kernel


* Tom Rini <trini@kernel.crashing.org> 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.
> 
> Signed-off-by: Tom Rini <trini@kernel.crashing.org>

thanks, applied.

	Ingo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] RT: Invert some TRACE_BUG_ON_LOCKED tests
  2005-09-12 13:43   ` Ingo Molnar
@ 2005-09-12 13:47     ` Ingo Molnar
  0 siblings, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2005-09-12 13:47 UTC (permalink / raw)
  To: Tom Rini; +Cc: dwalker, linux-kernel, Steven Rostedt, Thomas Gleixner


* Ingo Molnar <mingo@elte.hu> wrote:

> 
> * Tom Rini <trini@kernel.crashing.org> 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.
> > 
> > Signed-off-by: Tom Rini <trini@kernel.crashing.org>
> 
> thanks, applied.

actually - the inversion of the tests is incorrect on SMP. The right 
solution is Steven Rostedt's patch. (i took another variant of that 
approach, from Thomas Gleixner)

	Ingo

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-09-12 13:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2005-09-06 15:16       ` Tom Rini
2005-09-12 13:43   ` Ingo Molnar
2005-09-12 13:47     ` Ingo Molnar

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.