[patchset] Generic IRQ Subsystem: -V4

From: Ingo Molnar
Date: Wed May 17 2006 - 18:17:02 EST

This is Version 4 of the genirq patch-queue, against 2.6.17-rc4. This
patch-queue improves the generic IRQ layer to be truly generic, by
adding various abstractions and features to it, without impacting
existing functionality.

The number of patches has increased to 56 and the total patchsize has
increased to 294K, so we wont be sending the patches to lkml. The full
patch-queue can be downloaded from:


The split-out queue is at:


In -V4 there are lots of changes all around the map. The most
significant one is the conversion of the i386 and the x86_64
architectures to a fully irq-chip based IRQ handling model.

This brought nice simplifications for these architectures:

$ diffstat patches/genirq-i386-irqchip.patch

arch/i386/kernel/i8259.c | 45 +++--------
arch/i386/kernel/io_apic.c | 171 ++++++++++++++-------------------------------
arch/i386/kernel/irq.c | 19 ++---
include/asm-i386/hw_irq.h | 2
4 files changed, 80 insertions(+), 157 deletions(-)

$ diffstat patches/genirq-x86_64-irqchip.patch

arch/x86_64/kernel/i8259.c | 50 +++----------
arch/x86_64/kernel/io_apic.c | 165 ++++++++++---------------------------------
arch/x86_64/kernel/irq.c | 7 +
include/asm-x86_64/hw_irq.h | 2
4 files changed, 60 insertions(+), 164 deletions(-)

the IRQ handling hotpath for the most optimal flow got faster and
leaner. The number of functions called in a typical IRQ decreased too.
The irqchip implementations have become short and sweet:

static struct irq_chip ioapic_chip __read_mostly = {
.name = "IO-APIC",
.startup = startup_ioapic_vector,
.mask = mask_ioapic_vector,
.unmask = unmask_ioapic_vector,
.ack = ack_apic,
.set_affinity = set_ioapic_affinity_vector,
.retrigger = ioapic_retrigger_vector,

static struct irq_chip lapic_chip __read_mostly = {
.name = "local-APIC-edge",
.mask = mask_lapic_irq,
.unmask = unmask_lapic_irq,
.ack = ack_apic,

static struct irq_chip i8259A_chip = {
.name = "XT-PIC",
.mask = disable_8259A_irq,
.unmask = enable_8259A_irq,
.mask_ack = mask_and_ack_8259A,

see the split-out patches at:


Another new feature is the handle_level_irq_fastack() highlevel irq-flow
handler, which allows faster IRQ handling without masking/unmasking.
This is current used by the new i386 and x86_64 IO-APIC code, but it
could also be useful to most optimally support transparent ACK sequences
in OpenPIC/MPIC controllers.

There were also extensive renames done to make the irq_chip and irq_desc
fields clearer.

All changes since -V3:

- fixed set_wake prototype bug (reported by Daniel Walker)

- documentation fixes (Randy Dunlap)

- call desc->handle_irq() highlevel irq-flow handlers from __do_IRQ()
too, allowing gradual transition from a __do_IRQ() based model to an
irq-chips model. This was used for the i386 and x86_64 transition with
great success.

- ARM updates

- More size reduction:

text data bss dec hex filename
3430374 985464 1325080 5740918 579976 vmlinux-x64.orig
3434234 982216 1321240 5737690 578cda vmlinux-x64.genirq

while .text got larger, .data and .bss got smaller, so it's a net
size reduction of ~4K.

- better debugging info from spurious interrupts.

- truly remove the irq_dir[] and smp_affinity_entry[] arrays. (this
change was announced in -V3 but went MIA)

- introduced the handle_level_irq_fastack() highlevel flow handler, for
fast IO-APIC interrupt handling. This should enable the most optimal
flow for transparent-ACK IRQ controllers too. (such as OpenPIC/MPIC)

- pushed desc->lock handling into the highlevel flow handlers. This
unified and simplified the arch-level call sites.

- sem2mutex: kernel/irq/autoprobe.c probe_sem => probe_lock mutex

- changed the desc->handle_irq() handlers to be explicit fastcalls, to
keep the 4K_STACKS assembly code simpler.

- removed desc->affinity_entry - nothing uses it

- added chip->name as the primary field - chip->typename is still
kept for compatibility purposes.

- probe_irq() related fix in drivers/mfd/ucb1x00-core.c

- include flow information in /proc/interrupts for irq-chip based
architectures too.

- genirq-i386-irqchip.patch: change the i386 architecture to be irqchip

- genirq-x86_64-irqchip.patch: change the x86_64 architecture to be
irqchip based.

- renamed 'desc->handler' to 'desc->chip' - the code got much cleaner
due to this.

- retrigger fix on i386 and x86_64, it is now MSI-vector aware.

- renamed 'desc->handle' to 'desc->handle_irq'

- moved the set_irq_handler() method of setting desc->handle_irq() from
ARM into the generic code.

-V4 has been build-tested with allyesconfig, and booted on x86, x86_64
and various ARM platforms. Nevertheless the new i386 and x86_64 IRQ code
is experimental and has been tested only on a limited number of systems.

Ingo, Thomas
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/