2019-04-18 21:10:33 +08:00
|
|
|
==============================
|
2005-04-17 06:20:36 +08:00
|
|
|
IRQ affinity on IA64 platforms
|
2019-04-18 21:10:33 +08:00
|
|
|
==============================
|
|
|
|
|
|
|
|
07.01.2002, Erich Focht <efocht@ess.nec.de>
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
By writing to /proc/irq/IRQ#/smp_affinity the interrupt routing can be
|
|
|
|
controlled. The behavior on IA64 platforms is slightly different from
|
2020-05-01 23:37:51 +08:00
|
|
|
that described in Documentation/core-api/irq/irq-affinity.rst for i386 systems.
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
Because of the usage of SAPIC mode and physical destination mode the
|
|
|
|
IRQ target is one particular CPU and cannot be a mask of several
|
|
|
|
CPUs. Only the first non-zero bit is taken into account.
|
|
|
|
|
|
|
|
|
2019-04-18 21:10:33 +08:00
|
|
|
Usage examples
|
|
|
|
==============
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
The target CPU has to be specified as a hexadecimal CPU mask. The
|
|
|
|
first non-zero bit is the selected CPU. This format has been kept for
|
|
|
|
compatibility reasons with i386.
|
|
|
|
|
|
|
|
Set the delivery mode of interrupt 41 to fixed and route the
|
2019-04-18 21:10:33 +08:00
|
|
|
interrupts to CPU #3 (logical CPU number) (2^3=0x08)::
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
echo "8" >/proc/irq/41/smp_affinity
|
|
|
|
|
|
|
|
Set the default route for IRQ number 41 to CPU 6 in lowest priority
|
2019-04-18 21:10:33 +08:00
|
|
|
delivery mode (redirectable)::
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
echo "r 40" >/proc/irq/41/smp_affinity
|
|
|
|
|
2019-04-18 21:10:33 +08:00
|
|
|
The output of the command::
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
cat /proc/irq/IRQ#/smp_affinity
|
2019-04-18 21:10:33 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
gives the target CPU mask for the specified interrupt vector. If the CPU
|
|
|
|
mask is preceded by the character "r", the interrupt is redirectable
|
|
|
|
(i.e. lowest priority mode routing is used), otherwise its route is
|
|
|
|
fixed.
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-04-18 21:10:33 +08:00
|
|
|
Initialization and default behavior
|
|
|
|
===================================
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
If the platform features IRQ redirection (info provided by SAL) all
|
|
|
|
IO-SAPIC interrupts are initialized with CPU#0 as their default target
|
|
|
|
and the routing is the so called "lowest priority mode" (actually
|
|
|
|
fixed SAPIC mode with hint). The XTP chipset registers are used as hints
|
|
|
|
for the IRQ routing. Currently in Linux XTP registers can have three
|
|
|
|
values:
|
2019-04-18 21:10:33 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
- minimal for an idle task,
|
|
|
|
- normal if any other task runs,
|
|
|
|
- maximal if the CPU is going to be switched off.
|
2019-04-18 21:10:33 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
The IRQ is routed to the CPU with lowest XTP register value, the
|
|
|
|
search begins at the default CPU. Therefore most of the interrupts
|
|
|
|
will be handled by CPU #0.
|
|
|
|
|
|
|
|
If the platform doesn't feature interrupt redirection IOSAPIC fixed
|
|
|
|
routing is used. The target CPUs are distributed in a round robin
|
|
|
|
manner. IRQs will be routed only to the selected target CPUs. Check
|
2019-04-18 21:10:33 +08:00
|
|
|
with::
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
cat /proc/interrupts
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-04-18 21:10:33 +08:00
|
|
|
Comments
|
|
|
|
========
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
On large (multi-node) systems it is recommended to route the IRQs to
|
|
|
|
the node to which the corresponding device is connected.
|
|
|
|
For systems like the NEC AzusA we get IRQ node-affinity for free. This
|
|
|
|
is because usually the chipsets on each node redirect the interrupts
|
|
|
|
only to their own CPUs (as they cannot see the XTP registers on the
|
|
|
|
other nodes).
|