Re: Patch for faster interrupt handling.

Andi Kleen (ak@muc.de)
Tue, 4 Aug 1998 15:47:00 +0200


On Tue, Aug 04, 1998 at 09:24:14AM +0200, Linus Torvalds wrote:
> On Tue, 4 Aug 1998, Andi Kleen wrote:
> >
> > This patch makes gcc generate better code in do_8254A_IRQ for the
> > UniProcessor case. The problem is that gcc generates horrible for
> > long long on i386, and cached_irq_mask was a long long. It only needs
> > to be 64bits to handle all the 64 IO-APIC IRQs, but on UP which supports
> > 16 8254A interrupts only that is clearly not needed.
>
> Well, the particular feature wasn't needed on SMP either: the bitmask in
> "cached_irq_mask" is only relevant for the old-style irq's anyway now that
> the io-apic interrupt handling has been cleaned up from the original "as
> close to the old 8259 code as possible" code. So the high bits are
> actually not needed, and haven't been used for some time any more.
>
> As such, I'd rather just clean it up a bit more, and this is my first cut.
> The code quality should be as good or better than with your patch, and it
> doesn't need any SMP/UP tests because both are the same. I might have
> overlooked something, but please give me feedback.
>
> This also contains the fixes to hopefully make it work on
> - UP (silly compiler bug workaround version II)
> - plain Pentium (not "Pro" or "II") SMP (bootup sequence bug)
>
> I've verified that it compiles UP, but haven't verified that it actually
> does anything interesting, so caveat emptor. The code looks sane, and the
> changes are pretty straightforward cleanups, but there might be a typo or
> something.

It seems to work on my PII/UP. Thank you.

Some more comments after reviewing irq.c:

- The comment in do_IRQ seems to refer to a previous version of the code
and is confusing.
- do_IRQ itself seems wasteful - it does nothing interesting. How about
inlining the bottom half check and the interrupt counter increase into
the low level IRQ handlers? Then common_irq could directly call the low
level irq vector and some unnecessary code would be saved.

The only ugly thing is that it would need to compute smp_processor_id()
in assembly, but because entry.S does this already I don't see a big
problem with it.

- In do_8259A_IRQ I think enable_8259A_irq() should be inlined because it
is so short.

I was also wondering if SAVE_ALL really needs to save all registers, because
the C functions already save some. Do low level IRQ handlers really look
at regs?

-Andi

-
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.altern.org/andrebalsa/doc/lkml-faq.html