Re: new IRQ scalability changes in 2.3.48

From: Andrea Arcangeli (andrea@suse.de)
Date: Sun Feb 27 2000 - 12:02:31 EST


On Sun, 27 Feb 2000, Ingo Molnar wrote:

> - the irq_handler->end() semantics had to be changed slightly to
> allow the fastest possible IO-APIC IRQ handling on x86.

The ->end callback is deadlock prone actually (that probably can't be
reproduced on x86 though because of the ack and because irq gets delivered
only to one cpu). The ->end callback has to check if the irq is been
disabled as it's doing in 2.3.48, but it _has_ also to check if the irq is
currently in progress (and it wasn't doing that).

What was happening to my machine is that I was locking up in __sti() in
handle_IRQ_event() due irq recursion.

        CPU0 CPU1
        ------------------- ------------
        do_IRQ
        set inprogress
        ->ack (disable_irq
                                        do_IRQ
                                        spin_lock
        spin_unlock
                                        got the lock
                                        is inprogress so goto end
                                        ->end
                                        it's not disabled so enable_irq()!!
        handle_IRQ_event
        __sti()
        lockup: irq was enabled
                        
This is the fix. But don't apply it yet. I'll include it along with the
all other platform updates. Now I am running 2.3.48+alpha irq affinity and
cleanups and it's rock solid here ;). I changed also the x86 since it
looks more robust and more correct.

--- 2.3.48aa1-alpha/arch/alpha/kernel/sys_dp264.c.~1~ Sun Feb 27 17:17:23 2000
+++ 2.3.48aa1-alpha/arch/alpha/kernel/sys_dp264.c Sun Feb 27 19:03:29 2000
@@ -133,7 +133,7 @@
 static void
 dp264_end_irq(unsigned int irq)
 {
- if (!(irq_desc[irq].status & IRQ_DISABLED))
+ if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
                 dp264_enable_irq(irq);
 }
 
@@ -165,7 +165,7 @@
 static void
 clipper_end_irq(unsigned int irq)
 {
- if (!(irq_desc[irq].status & IRQ_DISABLED))
+ if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
                 clipper_enable_irq(irq);
 }
 
--- 2.3.48aa1-alpha/arch/i386/kernel/i8259.c.~1~ Sun Feb 27 06:19:41 2000
+++ 2.3.48aa1-alpha/arch/i386/kernel/i8259.c Sun Feb 27 19:04:47 2000
@@ -131,7 +131,7 @@
 
 static void end_8259A_irq (unsigned int irq)
 {
- if (!(irq_desc[irq].status & IRQ_DISABLED))
+ if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
                 enable_8259A_irq(irq);
 }
 

Andrea

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Feb 29 2000 - 21:00:18 EST