public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -rt 0/2] Get x86_64 running with PREEMPT_RT
@ 2006-05-26 16:06 Steven Rostedt
  2006-05-26 16:06 ` [PATCH -rt 1/2] Dont blindly turn on interrupts in boot_override_clocksource Steven Rostedt
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Steven Rostedt @ 2006-05-26 16:06 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Ingo Molnar, Mark Knecht, Clark Williams, Robert Crocombe,
	Thomas Gleixner, john stultz


The following two patches get PREEMPT_RT running on x86_64.  I'm currently
writing this from my x86_64 box running 2.6.16-rt23.

The first patch probably only affected me, since it was caused by
having clocksource=XXX in the command line.

The other patch simply fixes a bad condition in the default_idle
which prevented the idle task from ever scheduling (that was bad!)

-- Steve

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

* [PATCH -rt 1/2] Dont blindly turn on interrupts in boot_override_clocksource
  2006-05-26 16:06 [PATCH -rt 0/2] Get x86_64 running with PREEMPT_RT Steven Rostedt
@ 2006-05-26 16:06 ` Steven Rostedt
  2006-05-26 17:39   ` Ingo Molnar
  2006-05-26 16:06 ` [PATCH -rt 2/2] Fix condition in default_idle Steven Rostedt
  2006-05-26 18:19 ` [PATCH -rt 0/2] Get x86_64 running with PREEMPT_RT Clark Williams
  2 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2006-05-26 16:06 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Ingo Molnar, Mark Knecht, Clark Williams, Robert Crocombe,
	Thomas Gleixner, john stultz

[-- Attachment #1: clocksource-boot-irq-off.patch --]
[-- Type: text/plain, Size: 998 bytes --]

The boot_override_clocksource currently blindly turns on interrupts with
the releasing of the lock.  But if you have clocksource=xxx in the
command line, this function is called before interrupts are setup,
and causes early exception errors.

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

Index: linux-2.6.16-rt23/kernel/time/clocksource.c
===================================================================
--- linux-2.6.16-rt23.orig/kernel/time/clocksource.c	2006-05-25 16:01:00.000000000 -0400
+++ linux-2.6.16-rt23/kernel/time/clocksource.c	2006-05-25 16:01:28.000000000 -0400
@@ -323,10 +323,11 @@ device_initcall(init_clocksource_sysfs);
  */
 static int __init boot_override_clocksource(char* str)
 {
-	spin_lock_irq(&clocksource_lock);
+	unsigned long flags;
+	spin_lock_irqsave(&clocksource_lock, flags);
 	if (str)
 		strlcpy(override_name, str, sizeof(override_name));
-	spin_unlock_irq(&clocksource_lock);
+	spin_unlock_irqrestore(&clocksource_lock, flags);
 	return 1;
 }
 

--

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

* [PATCH -rt 2/2] Fix condition in default_idle
  2006-05-26 16:06 [PATCH -rt 0/2] Get x86_64 running with PREEMPT_RT Steven Rostedt
  2006-05-26 16:06 ` [PATCH -rt 1/2] Dont blindly turn on interrupts in boot_override_clocksource Steven Rostedt
@ 2006-05-26 16:06 ` Steven Rostedt
  2006-05-26 17:39   ` Ingo Molnar
  2006-05-26 18:19 ` [PATCH -rt 0/2] Get x86_64 running with PREEMPT_RT Clark Williams
  2 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2006-05-26 16:06 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Ingo Molnar, Mark Knecht, Clark Williams, Robert Crocombe,
	Thomas Gleixner, john stultz

[-- Attachment #1: fix-default_idle.patch --]
[-- Type: text/plain, Size: 901 bytes --]

The condition statement in default_idle had the conjunctions backwards.
Instead of && it had || so the idle thread would never be preempted.

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

Index: linux-2.6.16-rt23/arch/x86_64/kernel/process.c
===================================================================
--- linux-2.6.16-rt23.orig/arch/x86_64/kernel/process.c	2006-05-26 10:41:30.000000000 -0400
+++ linux-2.6.16-rt23/arch/x86_64/kernel/process.c	2006-05-26 10:41:44.000000000 -0400
@@ -120,9 +120,9 @@ void default_idle(void)
 
 	clear_thread_flag(TIF_POLLING_NRFLAG);
 	smp_mb__after_clear_bit();
-	while (!need_resched() || !need_resched_delayed()) {
+	while (!need_resched() && !need_resched_delayed()) {
 		local_irq_disable();
-		if (!need_resched() || !need_resched_delayed())
+		if (!need_resched() && !need_resched_delayed())
 			safe_halt();
 		else
 			local_irq_enable();

--

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

* Re: [PATCH -rt 1/2] Dont blindly turn on interrupts in boot_override_clocksource
  2006-05-26 16:06 ` [PATCH -rt 1/2] Dont blindly turn on interrupts in boot_override_clocksource Steven Rostedt
@ 2006-05-26 17:39   ` Ingo Molnar
  0 siblings, 0 replies; 6+ messages in thread
From: Ingo Molnar @ 2006-05-26 17:39 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Linux Kernel Mailing List, Mark Knecht, Clark Williams,
	Robert Crocombe, Thomas Gleixner, john stultz


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

> The boot_override_clocksource currently blindly turns on interrupts 
> with the releasing of the lock.  But if you have clocksource=xxx in 
> the command line, this function is called before interrupts are setup, 
> and causes early exception errors.

thanks, applied.

	Ingo

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

* Re: [PATCH -rt 2/2] Fix condition in default_idle
  2006-05-26 16:06 ` [PATCH -rt 2/2] Fix condition in default_idle Steven Rostedt
@ 2006-05-26 17:39   ` Ingo Molnar
  0 siblings, 0 replies; 6+ messages in thread
From: Ingo Molnar @ 2006-05-26 17:39 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Linux Kernel Mailing List, Mark Knecht, Clark Williams,
	Robert Crocombe, Thomas Gleixner, john stultz


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

> The condition statement in default_idle had the conjunctions 
> backwards. Instead of && it had || so the idle thread would never be 
> preempted.

> -	while (!need_resched() || !need_resched_delayed()) {
> +	while (!need_resched() && !need_resched_delayed()) {
>  		local_irq_disable();
> -		if (!need_resched() || !need_resched_delayed())
> +		if (!need_resched() && !need_resched_delayed())

doh! Good catch - applied.

	Ingo

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

* Re: [PATCH -rt 0/2] Get x86_64 running with PREEMPT_RT
  2006-05-26 16:06 [PATCH -rt 0/2] Get x86_64 running with PREEMPT_RT Steven Rostedt
  2006-05-26 16:06 ` [PATCH -rt 1/2] Dont blindly turn on interrupts in boot_override_clocksource Steven Rostedt
  2006-05-26 16:06 ` [PATCH -rt 2/2] Fix condition in default_idle Steven Rostedt
@ 2006-05-26 18:19 ` Clark Williams
  2 siblings, 0 replies; 6+ messages in thread
From: Clark Williams @ 2006-05-26 18:19 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Linux Kernel Mailing List, Ingo Molnar, Mark Knecht,
	Robert Crocombe, Thomas Gleixner, john stultz

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Steven Rostedt wrote:
> The following two patches get PREEMPT_RT running on x86_64.  I'm currently
> writing this from my x86_64 box running 2.6.16-rt23.
>
> The first patch probably only affected me, since it was caused by
> having clocksource=XXX in the command line.
>
> The other patch simply fixes a bad condition in the default_idle
> which prevented the idle task from ever scheduling (that was bad!)
Fixed my problem on Athlon64x2.

Thanks,
Clark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFEd0afHyuj/+TTEp0RAmMsAJ9Zf1n/GMHOB+SYXdI7fWGYfbkcVwCgrK6I
I0pV042x2vtPj7750lzIXeM=
=eMDn
-----END PGP SIGNATURE-----


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

end of thread, other threads:[~2006-05-26 18:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-26 16:06 [PATCH -rt 0/2] Get x86_64 running with PREEMPT_RT Steven Rostedt
2006-05-26 16:06 ` [PATCH -rt 1/2] Dont blindly turn on interrupts in boot_override_clocksource Steven Rostedt
2006-05-26 17:39   ` Ingo Molnar
2006-05-26 16:06 ` [PATCH -rt 2/2] Fix condition in default_idle Steven Rostedt
2006-05-26 17:39   ` Ingo Molnar
2006-05-26 18:19 ` [PATCH -rt 0/2] Get x86_64 running with PREEMPT_RT Clark Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox