[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Fix for your serial/PPP problems



> I've been trying it for over 24 hours, and I must say I'm quite impressed.
> PPP  performance has really increased. It is streaming for long periods without
> interruption. And no kernel Ooops or no problems.
> Seemingly no problems...
> Can anyone confirm these subjective enhancements ? I mean my PPP connection
> might just be better by other means...

To test if you're actually seeing improvement with irqtune, I'd try
transferring a large file between your machine and the machine you're
connected with (or a machine that's only a few links away) before
installing irqtune.  Note the transfer rate.  Do this a few times to get
an average as each time will vary a bit.  Then load irqtune and try
transferring the same file again several times and see if there's any
substantial improvement in the average transfer time. 

After I saw the original post about irqtune here, I decided to ask about
it on the kernel list.  Linus is looking into it now.  Apparently, irqtune
only helps with some (probably buggy) interrupt controllers.  Below is
Linus' reply along with a kernel patch that *may* possibly have the same
effect as irqtune on systems where irqtune does make a difference.  On my
system, I see no improvement whatsover with irqtune.  But, others have
seen substantial improvement.  Someone told me he saw some improvement but
at the cost of slowing down his SCSI drive.

Gerry

-----------------------------------------------------------------
>From torvalds@cs.Helsinki.FI  Fri Aug 23 03:45:42 1996
Return-Path: <torvalds@cs.Helsinki.FI>
Received: from porsta.cs.Helsinki.FI ([128.214.48.124]) by blue.optimed.com
	 with smtp (ident root using rfc1413) id <m0utsny-000A77C@blue.optimed.com>
	(Debian /\oo/\ Smail3.1.29.1 #29.37); Fri, 23 Aug 96 03:45 MDT
Received: from linux.cs.Helsinki.FI (linux.cs.Helsinki.FI [128.214.48.39]) by porsta.cs.Helsinki.FI (8.6.10/8.6.9) with SMTP id JAA23221; Fri, 23 Aug 1996 09:10:32 +0300
Date: Fri, 23 Aug 1996 09:08:43 +0300 (EET DST)
From: Linus Torvalds <torvalds@cs.Helsinki.FI>
To: Russell Berry <rberry@albany.net>
cc: Gerry Jensen <gerry@blue.optimed.com>, linux-kernel@vger.rutgers.edu
Subject: Re: irqtune: improve serial port performance by 3x?
In-Reply-To: <321CB992.555AC295@albany.net>
Message-ID: <Pine.LNX.3.91.960823090051.443A-100000@linux.cs.Helsinki.FI>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Status: RO
X-Status: 



On Thu, 22 Aug 1996, Russell Berry wrote:
> 
> I got this, installed it on both my machines (home/work), and can see a marked 
> increase in ppp performance.  However, I'm concerned about interrupt priorities, 
> does this effect _ONLY_ the timer interrupt priorities, or does it actually tweak
> the way the kernel interprets all system interrupts???

I don't like the fact that irqtune helsp interrupt performance, because the
way Linux tries to handle interrupts it _shouldn't_ make a difference. The
fact that irqtune obviously _does_ make a difference would indicate that the
irq handling has some problem, and irqtune just masks that problem by
changing the interrupt priority levels. 

Essentially, Linux does a "EOI" immediately when it gets the interrupt, and
that EOI _should_ mean that all other interrupts will get through, regardless
of whether they have lower or higher priority (because the EOI tells the
interrupt controller that it can forget about the interrupt that we're now
handling).  As such there should be no effect from irqtune, because the
interrupt priorities shouldn't really matter. 

However, Linux uses the "nonspecific" EOI to do this, and while that should
work, it may turn out that some interrupt controllers don't like it, and for
some reason mask the wrong interrupt. People who see a difference with
irqtune, could you test this patch instead (it changes the low-level
interrupt handlers to use the "specific" EOI to tell the controller that that
specific interrupt is now handled). 

I'd be very interested in reactions to this patch indeed, can you please 
try it out and tell me whether this makes any difference?

(This is against 2.0.14, but it should patch in cleanly against just about
any reasonably recent kernel. Certainly all of the 2.0.x series)

		Linus
----
--- v2.0.14/linux/include/asm-i386/irq.h	Sun Mar 10 09:28:56 1996
+++ linux/include/asm-i386/irq.h	Fri Aug 23 08:18:12 1996
@@ -81,7 +81,7 @@
  * a bit - without them it seems that the harddisk driver won't work on
  * all hardware. Arghh.
  */
-#define ACK_FIRST(mask) \
+#define ACK_FIRST(mask,nr) \
 	"inb $0x21,%al\n\t" \
 	"jmp 1f\n" \
 	"1:\tjmp 1f\n" \
@@ -90,10 +90,10 @@
 	"outb %al,$0x21\n\t" \
 	"jmp 1f\n" \
 	"1:\tjmp 1f\n" \
-	"1:\tmovb $0x20,%al\n\t" \
+	"1:\tmovb $0x60+"#nr",%al\n\t" \
 	"outb %al,$0x20\n\t"
 
-#define ACK_SECOND(mask) \
+#define ACK_SECOND(mask,nr) \
 	"inb $0xA1,%al\n\t" \
 	"jmp 1f\n" \
 	"1:\tjmp 1f\n" \
@@ -102,11 +102,12 @@
 	"outb %al,$0xA1\n\t" \
 	"jmp 1f\n" \
 	"1:\tjmp 1f\n" \
-	"1:\tmovb $0x20,%al\n\t" \
+	"1:\tmovb $0x60+"#nr",%al\n\t" \
 	"outb %al,$0xA0\n\t" \
 	"jmp 1f\n" \
 	"1:\tjmp 1f\n" \
-	"1:\toutb %al,$0x20\n\t"
+	"1:\tmovb $0x62,%al\n\t" \
+	"outb %al,$0x20\n\t"
 
 #define UNBLK_FIRST(mask) \
 	"inb $0x21,%al\n\t" \
@@ -207,7 +208,7 @@
 	"pushl $-"#nr"-2\n\t" \
 	SAVE_ALL \
 	ENTER_KERNEL \
-	ACK_##chip(mask) \
+	ACK_##chip(mask,(nr&7)) \
 	"incl "SYMBOL_NAME_STR(intr_count)"\n\t"\
 	"sti\n\t" \
 	"movl %esp,%ebx\n\t" \
@@ -224,7 +225,7 @@
 SYMBOL_NAME_STR(fast_IRQ) #nr "_interrupt:\n\t" \
 	SAVE_MOST \
 	ENTER_KERNEL \
-	ACK_##chip(mask) \
+	ACK_##chip(mask,(nr&7)) \
 	"incl "SYMBOL_NAME_STR(intr_count)"\n\t" \
 	"pushl $" #nr "\n\t" \
 	"call "SYMBOL_NAME_STR(do_fast_IRQ)"\n\t" \
@@ -238,7 +239,7 @@
 SYMBOL_NAME_STR(bad_IRQ) #nr "_interrupt:\n\t" \
 	SAVE_MOST \
 	ENTER_KERNEL \
-	ACK_##chip(mask) \
+	ACK_##chip(mask,(nr&7)) \
 	LEAVE_KERNEL \
 	RESTORE_MOST);
 	
@@ -255,7 +256,7 @@
 	"pushl $-"#nr"-2\n\t" \
 	SAVE_ALL \
 	ENTER_KERNEL \
-	ACK_##chip(mask) \
+	ACK_##chip(mask,(nr&7)) \
 	"incl "SYMBOL_NAME_STR(intr_count)"\n\t"\
 	"movl %esp,%ebx\n\t" \
 	"pushl %ebx\n\t" \
@@ -283,7 +284,7 @@
 	"pushl $-"#nr"-2\n\t" \
 	SAVE_ALL \
 	ENTER_KERNEL \
-	ACK_##chip(mask) \
+	ACK_##chip(mask,(nr&7)) \
 	"incl "SYMBOL_NAME_STR(intr_count)"\n\t"\
 	"sti\n\t" \
 	"movl %esp,%ebx\n\t" \
@@ -301,7 +302,7 @@
 "\n"__ALIGN_STR"\n" \
 SYMBOL_NAME_STR(fast_IRQ) #nr "_interrupt:\n\t" \
 	SAVE_MOST \
-	ACK_##chip(mask) \
+	ACK_##chip(mask,(nr&7)) \
 	SMP_PROF_IPI_CNT \
 	"pushl $" #nr "\n\t" \
 	"call "SYMBOL_NAME_STR(do_fast_IRQ)"\n\t" \
@@ -312,7 +313,7 @@
 "\n"__ALIGN_STR"\n" \
 SYMBOL_NAME_STR(bad_IRQ) #nr "_interrupt:\n\t" \
 	SAVE_MOST \
-	ACK_##chip(mask) \
+	ACK_##chip(mask,(nr&7)) \
 	RESTORE_MOST);
 
 #define BUILD_RESCHEDIRQ(nr) \
@@ -345,7 +346,7 @@
 SYMBOL_NAME_STR(IRQ) #nr "_interrupt:\n\t" \
 	"pushl $-"#nr"-2\n\t" \
 	SAVE_ALL \
-	ACK_##chip(mask) \
+	ACK_##chip(mask,(nr&7)) \
 	"incl "SYMBOL_NAME_STR(intr_count)"\n\t"\
 	"sti\n\t" \
 	"movl %esp,%ebx\n\t" \
@@ -360,7 +361,7 @@
 "\n"__ALIGN_STR"\n" \
 SYMBOL_NAME_STR(fast_IRQ) #nr "_interrupt:\n\t" \
 	SAVE_MOST \
-	ACK_##chip(mask) \
+	ACK_##chip(mask,(nr&7)) \
 	"incl "SYMBOL_NAME_STR(intr_count)"\n\t" \
 	"pushl $" #nr "\n\t" \
 	"call "SYMBOL_NAME_STR(do_fast_IRQ)"\n\t" \
@@ -372,7 +373,7 @@
 "\n"__ALIGN_STR"\n" \
 SYMBOL_NAME_STR(bad_IRQ) #nr "_interrupt:\n\t" \
 	SAVE_MOST \
-	ACK_##chip(mask) \
+	ACK_##chip(mask,(nr&7)) \
 	RESTORE_MOST);
 	
 #define BUILD_TIMER_IRQ(chip,nr,mask) \
@@ -386,7 +387,7 @@
 SYMBOL_NAME_STR(IRQ) #nr "_interrupt:\n\t" \
 	"pushl $-"#nr"-2\n\t" \
 	SAVE_ALL \
-	ACK_##chip(mask) \
+	ACK_##chip(mask,(nr&7)) \
 	"incl "SYMBOL_NAME_STR(intr_count)"\n\t"\
 	"movl %esp,%ebx\n\t" \
 	"pushl %ebx\n\t" \
-----




Reply to: