United States (change)
Shortcuts: Downloads Fedora Red Hat Network
Account Links: Cart Your Account Logout
Modules that are tied to a particular IRQ use an 8K portion of memory called the stack. For SMP machine their are multiple stacks; one for each processor. Occasionally, a poorly written module will consume a large portion of the stack not leave much space for other modules to use. This can lead to the catastrophic system failure known as a stack overflow.
To reduce stack pressure, it is desirable to have different modules use different stacks. This is accomplished through CPU IRQ affinity. CPU IRQ affinity avoids the condition of having multiple modules consuming an entire processor's stack while stack space is available on other processors. A module can be bound to one stack or masked to a set of processors stacks.
Techniques for binding an IRQ to a particular processor are outlined below but in Red Hat Enterprise Linux 3 (and Red Hat Enterprise Linux 2.1 U3) this is done automatically. So now networking, storage, timer, etc. IRQ's are divided into groups. Networking IRQ's get the first stack, then storage, timer, etc. Within each group, the balancer attempts to put at most one module instance per CPU. Once networking is placed, it starts placing storage; it will but the highest IRQ rate device on the stack with the fewest networking IRQ's. This is reevaluated every 10 seconds.
For example, on a two processor machine, to bind the driver for IRQ 18 to CPU 1, do the following:
echo 2 > /proc/irq/18/smp_affinityThis site explains the masking math:
http://bbcr.uwaterloo.ca/~brecht/servers/apic/SMP-affinity.txt
Additional information can be found in:
/usr/src/linux-2.4/Documentation/IRQ-affinity.txt