Skip to contentSkip to conversation

per isr in_progress markers

RFC PATCH [email protected] 2 participants 3 messages Sep 9, 2002 IRQ

lore
Share & tools
lore
#0 lore raw

Hi,
I sent you a bad patch yesterday.

Zwane

Index: linux-2.5.33/arch/i386/kernel/io_apic.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.33/arch/i386/kernel/io_apic.c,v retrieving revision 1.1.1.1

arch/i386/kernel/io_apic.c +2 -3
diff -u -r1.1.1.1 io_apic.c
@@ -1292,15 +1292,14 @@
 #define shutdown_edge_ioapic_irq	disable_edge_ioapic_irq
 
 /*
- * Once we have recorded IRQ_PENDING already, we can mask the
+ * Once we have recorded irq pending already, we can mask the
  * interrupt for real. This prevents IRQ storms from unhandled
  * devices.
  */
 static void ack_edge_ioapic_irq(unsigned int irq)
 {
 	balance_irq(irq);
-	if ((irq_desc[irq].status & (IRQ_PENDING | IRQ_DISABLED))
-					== (IRQ_PENDING | IRQ_DISABLED))
+	if (irq_desc[irq].pending && (irq_desc[irq].status & IRQ_DISABLED))
 		mask_IO_APIC_irq(irq);
 	ack_APIC_irq();
 }

Index: linux-2.5.33/arch/i386/kernel/irq.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.33/arch/i386/kernel/irq.c,v retrieving revision 1.1.1.1

arch/i386/kernel/irq.c +57 -19

176 lines not on this page · raw message

Index: linux-2.5.33/include/asm-i386/hw_irq.h
===================================================================
RCS file: /build/cvsroot/linux-2.5.33/include/asm-i386/hw_irq.h,v retrieving revision 1.1.1.1

include/asm-i386/hw_irq.h +1 -0
diff -u -r1.1.1.1 hw_irq.h
@@ -43,6 +43,7 @@
 
 extern void mask_irq(unsigned int irq);
 extern void unmask_irq(unsigned int irq);
+extern void isr_unmask_irq(unsigned int irq);
 extern void disable_8259A_irq(unsigned int irq);
 extern void enable_8259A_irq(unsigned int irq);
 extern int i8259A_irq_pending(unsigned int irq);

Index: linux-2.5.33/include/asm-i386/signal.h
===================================================================
RCS file: /build/cvsroot/linux-2.5.33/include/asm-i386/signal.h,v retrieving revision 1.1.1.1

include/asm-i386/signal.h +1 -0
diff -u -r1.1.1.1 signal.h
@@ -120,6 +120,7 @@
 #define SA_PROBE		SA_ONESHOT
 #define SA_SAMPLE_RANDOM	SA_RESTART
 #define SA_SHIRQ		0x04000000
+#define SA_UNMASKIRQ		SA_NOMASK
 #endif
 
 #define SIG_BLOCK          0	/* for blocking signals */

Index: linux-2.5.33/include/linux/interrupt.h
===================================================================
RCS file: /build/cvsroot/linux-2.5.33/include/linux/interrupt.h,v retrieving revision 1.1.1.1

include/linux/interrupt.h +3 -0
diff -u -r1.1.1.1 interrupt.h
@@ -13,6 +13,8 @@
 #include <asm/system.h>
 #include <asm/ptrace.h>
 
+#define ISR_INPROGRESS	1	/* ISR currently being executed */
+
 struct irqaction {
 	void (*handler)(int, void *, struct pt_regs *);
 	unsigned long flags;
@@ -20,6 +22,7 @@
 	const char *name;
 	void *dev_id;
 	struct irqaction *next;
+	unsigned long status;
 };
 
 

Index: linux-2.5.33/include/linux/irq.h
===================================================================
RCS file: /build/cvsroot/linux-2.5.33/include/linux/irq.h,v retrieving revision 1.1.1.1

include/linux/irq.h +7 -7
diff -u -r1.1.1.1 irq.h
@@ -24,13 +24,12 @@
  */
 #define IRQ_INPROGRESS	1	/* IRQ handler active - do not enter! */
 #define IRQ_DISABLED	2	/* IRQ disabled - do not enter! */
-#define IRQ_PENDING	4	/* IRQ pending - replay on enable */
-#define IRQ_REPLAY	8	/* IRQ has been replayed but not acked yet */
-#define IRQ_AUTODETECT	16	/* IRQ is being autodetected */
-#define IRQ_WAITING	32	/* IRQ not yet seen - for autodetection */
-#define IRQ_LEVEL	64	/* IRQ level triggered */
-#define IRQ_MASKED	128	/* IRQ masked - shouldn't be seen again */
-#define IRQ_PER_CPU	256	/* IRQ is per CPU */
+#define IRQ_REPLAY	4	/* IRQ has been replayed but not acked yet */
+#define IRQ_AUTODETECT	8	/* IRQ is being autodetected */
+#define IRQ_WAITING	16	/* IRQ not yet seen - for autodetection */
+#define IRQ_LEVEL	32	/* IRQ level triggered */
+#define IRQ_MASKED	64	/* IRQ masked - shouldn't be seen again */
+#define IRQ_PER_CPU	128	/* IRQ is per CPU */
 
 /*
  * Interrupt controller descriptor. This is all we need
@@ -62,6 +61,7 @@
 	struct irqaction *action;	/* IRQ action list */
 	unsigned int depth;		/* nested irq disables */
 	spinlock_t lock;
+	unsigned int pending;
 } ____cacheline_aligned irq_desc_t;
 
 extern irq_desc_t irq_desc [NR_IRQS];
#1 lore raw
Quoted 1 line · On Mon, 2002-09-09 at 05:49, [email protected] wrote:

I sent you a bad patch yesterday.

I think Linus raises some important points wrt SMP performance. At the same time, I think your patch is very simple and has the possibility to provide improved performance on SMP _and_ UP when dealing with busy shared interrupt handlers.

For example, consider two handlers on the same line. Even on UP, we can find one slower handler blocking the run of another. So I think the benefit to latency is clear.

I dunno about throughput... Linus's points need to be addressed.

Robert Love

#2 lore raw
Quoted 1 line · Robert Love

I dunno about throughput... Linus's points need to be addressed.

Yep agreed, i'm going to try and get numbers.

Thanks,
Zwane

Signature · 1 line
function.linuxpower.ca