Skip to main content

Linux Interrupts (IRQ)

Concepts

  • Interrupt: A method by which hardware communicates with the processor.
  • IRQ (Interrupt Request Line): A number used to describe an interrupt.
    • Typical PC has 16 IRQs (0-15).
    • Many are reserved (timer, keyboard, etc.).

IRQ Assignment

IRQDeviceNote
0timercan't be changed
1keyboardcan't be changed
2irq9 cascadecan't be changed
3com 2/4
4com 1/3
5usually free
6floppy disk
7lpt1
8clockcan't be changed
9usually freemay be labelled as irq 2 due to cascading
10free
11free
12mouse
13co-processorcan't be changed
14Pri eide adapter
15secondary eide adapter

Controllers

  • APIC (Advanced Processor Interrupt Controller): Overcomes the 16 IRQ limit. Adds 24+ IRQs per APIC.
  • IO-APIC
  • PCI-MSI

Debugging & Tuning

# Check IRQs
lspci -v | grep IRQ
# Bus-centric view
lspci -vb | grep IRQ
  • Troubleshooting Tips:

    • Disable unused devices in BIOS (USB, Audio, etc.).
    • Assign IRQ to specific PCI slot in BIOS (if available).
    • Move card to different PCI slot.
    • Disable "Plug 'n Play OS" in BIOS.
    • Enable APIC in kernel.
    • Disable IRQ load balancing.
  • dahdi_test: > 99.98% ok. < 99.975% problems.

  • dahdi_tool: check IRQ misses.

  • PCI Latency: min=0, max=248.

SMP Affinity

# Check affinity
cat /proc/irq/16/smp_affinity

# Set affinity (e.g., CPU 2 or 2-3)
echo -n 2-3 > /proc/irq/16/smp_affinity_list
echo -n 2 > /proc/irq/16/smp_affinity

PRI & Signalling

  • Asterisk Guru: PRI

  • T1 (NA/Japan): 23 B + 1 D.

  • E1 (Europe/Aus): 30 B + 1 D.

  • B-channel: Voice/Data.

  • D-channel: Signalling (Call setup/teardown).

  • CAS (Channel Associated Signalling): Bits replicate circuit status or tone signalling clearly.

  • CCS (Common Channel Signalling): ISDN/SS7. Messages sent over signalling channel.