Subject: Re: irqtune: improve serial port performance by 3x?

From: Linus Torvalds <[email-masked]>
Date: Sun, 1 Sep 1996 11:12:42 +0300 (EET DST)

Hi again..

In my never-ending battle to make the kernel behave well by default without
needing "irqtune" (which is very setup-specific, and as such not something
the kernel can do automatically), I was thinking of doing interrupt priority
rotations instead of the current fixed mode. 

Now, doing a rotating interrupt priority means that the priorities
essentially go away completely, which is not the optimal solution (having
high serial line priorities is good, no question about it). However, while
not exactly optimal, it _is_ a fair solution, and likely to be better than
what we currently have. 

Rotating priorities should also work reasonably well for multiple serial
interrupt sources, which irqtune doesn't really handle (depending on what the
interrupt numbers are, irqtune can work well, though). Also, unlike irqtune,
there shouldn't be any unfairness toward other devices so it should work well
under wildly different circumstances. 

In short, rotating priorities are a reasonable thing to do by default, 
and I'd like people who have been trying out "irqtune" (and who actually 
see some differences with it) to try out this very simple patch.. How 
does this work for you?

(This is actually how Linux/alpha has been handling interrupts from the very
beginning)

		Linus

-----
--- v2.0.16/linux/include/asm-i386/irq.h	Thu Aug 29 19:15:14 1996
+++ linux/include/asm-i386/irq.h	Sun Sep  1 10:53:04 1996
@@ -90,7 +90,7 @@
 	"outb %al,$0x21\n\t" \
 	"jmp 1f\n" \
 	"1:\tjmp 1f\n" \
-	"1:\tmovb $0x60+"#nr",%al\n\t" \
+	"1:\tmovb $0xE0+"#nr",%al\n\t" \
 	"outb %al,$0x20\n\t"
 
 #define ACK_SECOND(mask,nr) \
@@ -102,11 +102,11 @@
 	"outb %al,$0xA1\n\t" \
 	"jmp 1f\n" \
 	"1:\tjmp 1f\n" \
-	"1:\tmovb $0x60+"#nr",%al\n\t" \
+	"1:\tmovb $0xE0+"#nr",%al\n\t" \
 	"outb %al,$0xA0\n\t" \
 	"jmp 1f\n" \
 	"1:\tjmp 1f\n" \
-	"1:\tmovb $0x62,%al\n\t" \
+	"1:\tmovb $0xE2,%al\n\t" \
 	"outb %al,$0x20\n\t"
 
 #define UNBLK_FIRST(mask) \

---

From: Philippe Troin <[email-masked]>
Date: Tue, 03 Sep 1996 11:47:18 -0700

> rotations instead of the current fixed mode. 

Just to tell you that this patch gave me the same effect as irqtune did before: full serial speed. Actually, I applied the 2.0.17 patch which contained this small patch.
I'm glad this thing's in the kernel now.

Phil.

---

From: Linus Torvalds <[email-masked]>
Date: Wed, 4 Sep 1996 09:49:34 +0300 (EET DST)

On Tue, 3 Sep 1996, Philippe Troin wrote:
> Just to tell you that this patch gave me the same effect as irqtune did
> before: full serial speed. Actually, I applied the 2.0.17 patch which
> contained this small patch. 
>

I have one report of a hung kernel at bogomips time, which seems to indicate
that the priority rotations do not work at all with certain chipsets
(probably a buggy interrupt controller). I may have to revert to the
non-rotating version after all. 

Damn.

		Linus