linux-mips
[Top] [All Lists]

2.4 preempt kernel patch

To: linux-mips@linux-mips.org
Subject: 2.4 preempt kernel patch
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Fri, 28 May 2004 13:12:36 +0900 (JST)
Cc: jsun@mvista.com
Organization: TOSHIBA Personal Computer System Corporation
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Hi.  I'm investigating preempt patch for 2.4 kernel.  (MIPS part of
preempt-kernel-rml-2.4.26-pre5-1.patch seems a bit old.  I'm looking
Jun Sun's 030304-b.preempt-mips.patch).

The patch contains following block (end of
arch/mips/kernel/irq.c:do_IRQ()):

 
        if (softirq_pending(cpu))
                do_softirq();
+
+#if defined(CONFIG_PREEMPT)
+       for(;;) {
+               preempt_enable_no_resched();
+               if (preempt_is_disabled() || !need_resched())
+                       break;
+
+               db_assert(intr_off());
+               db_assert(!in_interrupt());
+
+               preempt_disable();
+               __sti();
+               preempt_schedule();
+               __cli();
+       }
+#endif
+
        return 1;
 }
 

Q1.  What is purpose of this block?  (To decrease latency?  But other
archs (and 2.6 MIPS kernel) do not have block like this...)

Q2.  If an interrupt happened between __sti() and __cli(), and the
interrupt handler raise softirq, the softirq handler will not be
called soon (because do_softirq() immediately return if preempt
disabled).  So we must check softirq_pending again after this block?

Thank you.
---
Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>