Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Jun Sun <jsun@mvista.com>
To: Colin.Helliwell@Zarlink.Com
Cc: linux-mips@linux-mips.org, jsun@mvista.com, rml@mvista.com
Subject: Re: Problems with CONFIG_PREEMPT
Date: Tue, 17 Dec 2002 10:03:07 -0800	[thread overview]
Message-ID: <20021217100307.E11575@mvista.com> (raw)
In-Reply-To: <OF78526308.B4153FAC-ON80256C92.002B416F@zarlink.com>; from Colin.Helliwell@Zarlink.Com on Tue, Dec 17, 2002 at 08:27:16AM +0000

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

On Tue, Dec 17, 2002 at 08:27:16AM +0000, Colin.Helliwell@Zarlink.Com wrote:
> 
> NEW_TIME_C is set. URL to the patch is:
> http://www.kernel.org/pub/linux/kernel/people/rml/preempt-kernel/v2.4/preempt-kernel-rml-2.4.19-2.patch
>

There are some bits missing.  Not sure if it is related to your problem or not.

Robert, please take the MIPS preemptible kernel update patch.

> We ultimately want to add in real-time support, such as Ingo's O(1)
> scheduler - if this is 'complete' for MIPS. 

O(1) shortens process dispatching time, usually not a big time saver
unless you have *lots* of process and/or you are doing frequent context
switches.

Another patch which is probably more important is the Ingo's breaking
selected big lock patch.  That will preemption work more effectively.

> I don't know if it would be
> better just to go for this in one hit, or if we'd need the preemption
> sorted out anyway first. 

You do have to sort them out one by one.  (Or you get them all by becoming
mvista customer. :-0)

> Or should we just go to a 2.5.x kernel instead?

We'd love to have more people bang on 2.5 MIPS *grin* ...

Jun
 

[-- Attachment #2: 021217-mips-2.4-prek-update.patch --]
[-- Type: text/plain, Size: 2511 bytes --]


Additional patch for MIPS against RML's 2.4.19-2 preemptiable kernel patch.

http://www.kernel.org/pub/linux/kernel/people/rml/preempt-kernel/v2.4/preempt-kernel-rml-2.4.19-2.patch

Jun

diff -Nru link/arch/mips/kernel/irq.c.orig link/arch/mips/kernel/irq.c
--- link/arch/mips/kernel/irq.c.orig	Tue Dec 17 09:44:29 2002
+++ link/arch/mips/kernel/irq.c	Tue Dec 17 09:44:45 2002
@@ -507,13 +507,13 @@
 		}
 
 		current->preempt_count ++;
-		sti();
+		__sti();
 		if (user_mode(regs)) {
 			schedule();
 		} else {
 			preempt_schedule();
 		}
-		cli();
+		__cli();
 	}
 #endif
 
diff -Nru link/arch/mips/kernel/time.c.orig link/arch/mips/kernel/time.c
--- link/arch/mips/kernel/time.c.orig	Mon Dec  2 16:56:03 2002
+++ link/arch/mips/kernel/time.c	Tue Dec 17 09:53:37 2002
@@ -416,6 +416,8 @@
 {
 	int cpu = smp_processor_id();
 
+	preempt_disable();
+
 	irq_enter(cpu, irq);
 	kstat.irqs[cpu][irq]++;
 
@@ -426,12 +428,34 @@
 
 	if (softirq_pending(cpu))
 		do_softirq();
+
+#if defined(CONFIG_PREEMPT)
+        while (--current->preempt_count == 0) {
+                db_assert(intr_off());
+                db_assert(!in_interrupt());
+
+                if (current->need_resched == 0) {
+                        break;
+                }
+
+                current->preempt_count ++;
+                __sti();
+                if (user_mode(regs)) {
+                        schedule();
+                } else {
+                        preempt_schedule();
+                }
+                __cli();
+        }
+#endif
 }
 
 asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs)
 {
 	int cpu = smp_processor_id();
 
+	preempt_disable();
+
 	irq_enter(cpu, irq);
 	kstat.irqs[cpu][irq]++;
 
@@ -442,6 +466,26 @@
 
 	if (softirq_pending(cpu))
 		do_softirq();
+
+#if defined(CONFIG_PREEMPT)
+	while (--current->preempt_count == 0) {
+		db_assert(intr_off());
+		db_assert(!in_interrupt());
+
+		if (current->need_resched == 0) {
+			break;
+		}
+
+		current->preempt_count ++;
+		__sti();
+		if (user_mode(regs)) {
+			schedule();
+		} else {
+			preempt_schedule();
+		}
+		__cli();
+	}
+#endif
 }
 
 /*
diff -Nru link/include/asm-mips/softirq.h.orig link/include/asm-mips/softirq.h
--- link/include/asm-mips/softirq.h.orig	Tue Dec 17 09:44:29 2002
+++ link/include/asm-mips/softirq.h	Tue Dec 17 09:54:13 2002
@@ -10,6 +10,9 @@
 #ifndef _ASM_SOFTIRQ_H
 #define _ASM_SOFTIRQ_H
 
+#include <linux/sched.h>
+#include <linux/spinlock.h>
+
 #include <asm/atomic.h>
 #include <asm/hardirq.h>
 

  reply	other threads:[~2002-12-17 18:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-17  8:27 Problems with CONFIG_PREEMPT Colin.Helliwell
2002-12-17 18:03 ` Jun Sun [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-12-20 14:51 Colin.Helliwell
2002-12-20 23:53 ` Jun Sun
2002-12-19  9:10 Colin.Helliwell
2002-12-19 17:59 ` Jun Sun
2002-12-16 13:58 Colin.Helliwell
2002-12-16 20:45 ` Jun Sun

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=20021217100307.E11575@mvista.com \
    --to=jsun@mvista.com \
    --cc=Colin.Helliwell@Zarlink.Com \
    --cc=linux-mips@linux-mips.org \
    --cc=rml@mvista.com \
    /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