2005-09-02 20:00:58

by Daniel Walker

[permalink] [raw]
Subject: [PATCH] RT: set LPPTEST default to off


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

Signed-Off-By: Daniel Walker <[email protected]>

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




2005-09-02 20:09:04

by Tom Rini

[permalink] [raw]
Subject: [PATCH] RT: Invert some TRACE_BUG_ON_LOCKED tests

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 <[email protected]>

--- 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/

2005-09-02 22:41:33

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH] RT: Invert some TRACE_BUG_ON_LOCKED tests

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



2005-09-02 22:54:19

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH] RT: Invert some TRACE_BUG_ON_LOCKED tests

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 <[email protected]>

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


2005-09-06 15:16:42

by Tom Rini

[permalink] [raw]
Subject: Re: [PATCH] RT: Invert some TRACE_BUG_ON_LOCKED tests

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/

2005-09-12 13:43:22

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH] RT: Invert some TRACE_BUG_ON_LOCKED tests


* Tom Rini <[email protected]> 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 <[email protected]>

thanks, applied.

Ingo

2005-09-12 13:46:55

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH] RT: Invert some TRACE_BUG_ON_LOCKED tests


* Ingo Molnar <[email protected]> wrote:

>
> * Tom Rini <[email protected]> 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 <[email protected]>
>
> 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