Account Links: Cart | Your Account | Logout

Skip to content

Red Hat Knowledgebase

Red Hat Knowledgebase Search:

Updated Within the Last:

New Solutions within the last day New Solutions within the last week New Solutions within the last month

Browse by topics:


Click to View a Topic
Red Hat Enterprise Linux > AS/ES/WS v. 3 > Issue <<  129 of 593 >>

Solution Tools:


Email a Solution Postcard Printer version Submit a comment on this answer Update notifications Request an answer Back

Article Reference

Article ID: 2640
Last update: 07-08-04
Issue:
How do I enable CPU IRQ affinity?
Resolution:

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_affinity

This 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


How well did this entry answer your question?


good wrong incomplete out of date
Red Hat Enterprise Linux > AS/ES/WS v. 3 > Issue <<   129  of  593  >>