RE: [patch] Real-Time Preemption, -RT-2.6.11-rc3-V0.7.38-01

Sven Dietrich
2005-02-11T00:09:39Z

[-- Attachment #1: Type: text/plain, Size: 1218 bytes --]

Hi George,

you may want to use this for reference.

This patch adds a config option to allow you to select whether timer IRQ runs in thread or not.

I'm not totally happy with the #ifdefs, but it may make witching back and forth easier.

Sven

> -----Original Message-----
> From: linux-kernel-owner@vger.kernel.org
> [mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of
> George Anzinger
> Sent: Thursday, February 10, 2005 12:21 PM
> To: Ingo Molnar
> Cc: William Weston; linux-kernel@vger.kernel.org
> Subject: Re: [patch] Real-Time Preemption, -RT-2.6.11-rc3-V0.7.38-01
>
>
> If I want to write a patch that will work with or without the
> RT patch applied
> is the following enough?
>
> #ifndef RAW_SPIN_LOCK_UNLOCKED
> typedef raw_spinlock_t spinlock_t
> #define RAW_SPIN_LOCK_UNLOCKED SPIN_LOCK_UNLOCKED
> #endif
>
>
> --
> George Anzinger george@mvista.com
> High-res-timers: http://sourceforge.net/projects/high-res-timers/
>
> -
> To unsubscribe from this list: send the line "unsubscribe
> linux-kernel" in the body of a message to
> majordomo@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

[-- Attachment #2: common_timer_irqthread.patch --]
[-- Type: application/octet-stream, Size: 1956 bytes --]

Index: linux-2.6.10-Omap1710/include/linux/time.h
===================================================================
--- linux-2.6.10-Omap1710.orig/include/linux/time.h 2005-02-03 09:06:40.378530238 +0000
+++ linux-2.6.10-Omap1710/include/linux/time.h 2005-02-03 09:20:37.703894461 +0000
@@ -80,7 +80,20 @@

extern struct timespec xtime;
extern struct timespec wall_to_monotonic;
-extern raw_seqlock_t xtime_lock;
+
+#ifndef ARCH_HAVE_XTIME_LOCK
+
+ #ifdef PREEMPT_TIMER_IRQ
+ #define XTIME_LOCK_T seqlock_t
+ #define DECLARE_XTIME_LOCK DECLARE_SEQLOCK(xtime_lock)
+ #else
+ #define XTIME_LOCK_T raw_seqlock_t
+ #define DECLARE_XTIME_LOCK DECLARE_RAW_SEQLOCK(xtime_lock)
+ #endif
+
+extern XTIME_LOCK_T xtime_lock;
+
+#endif

static inline unsigned long get_seconds(void)
{
Index: linux-2.6.10-Omap1710/kernel/timer.c
===================================================================
--- linux-2.6.10-Omap1710.orig/kernel/timer.c 2005-02-03 09:06:40.379529900 +0000
+++ linux-2.6.10-Omap1710/kernel/timer.c 2005-02-03 09:52:42.418866172 +0000
@@ -943,7 +943,7 @@
* playing with xtime and avenrun.
*/
#ifndef ARCH_HAVE_XTIME_LOCK
-DECLARE_RAW_SEQLOCK(xtime_lock);
+DECLARE_XTIME_LOCK;

EXPORT_SYMBOL(xtime_lock);
#endif
Index: linux-2.6.10-Omap1710/lib/Kconfig.RT
===================================================================
--- linux-2.6.10-Omap1710.orig/lib/Kconfig.RT 2005-02-03 09:06:40.379529900 +0000
+++ linux-2.6.10-Omap1710/lib/Kconfig.RT 2005-02-03 09:06:49.185545306 +0000
@@ -119,6 +119,14 @@

Say N if you are unsure.

+config PREEMPT_TIMER_IRQ
+ bool "Run timer IRQ in a thread"
+ default y
+ depends on PREEMPT_HARDIRQS && ARM
+ help
+ This declares the xtime_lock as a mutex and allows
+ running the timer interrupt in a thread.
+
config SPINLOCK_BKL
bool "Old-Style Big Kernel Lock"
depends on (PREEMPT || SMP) && !PREEMPT_RT