12.07.2015 Views

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

444CHAPTER 21Monitoring and Tuning the KernelEach IRQ being used has its own directory in /proc/irq/, where the directory name is theIRQ number, and each of these directories has a file named smp_affinity in it. Each ofthese smp_affinity files contains a number in bitmask in hexadecimal format, representingwhich processor or processors to send interrupts to.This bitmask number contains eight numbers, each representing four processors. The firstfour processors are represented by the right-most number, the second four processors arerepresented by the number to the left of that, and so on, for a total of 32 processors.In hex notation, the numbers 0 through 9 represent the decimal numbers 0 through 9,and the numbers a through f represent the decimal numbers 10 through 15. To determinethe hexadecimal number for each processor, its binary number must be converted to hex.Table 21.4 shows the binary to hex conversion.TABLE 21.4 Binary to Hex ConversionProcessor Number Binary Hex1 0001 12 0010 23 0100 44 1000 8When setting SMP IRQ affinity, add the hexadecimal values of two or more processors ifyou want to assign more than one processor to an IRQ. For example, to represent the firstand fourth processors, adding the hex numbers 1 and 8 results in the hex number 9.Adding hex numbers 4 and 8 for the third and fourth processors results in hex number c.All four processors are represented by the hex number f.To set the SMP IRQ affinity for a specific interrupt, use the echo command to change thevalue of /proc/irq//smp_affinity. In Listing 21.6, the Ethernet controller usesIRQ 66. Using the cat /proc/irq/66/smp_affinity command shows all Ethernetcontroller interrupts are sent to the first processor. To send interrupts to both processors,use the following command:echo 2 > /proc/irq/66/smp_affinityThe taskset utility allows administrators to configure SMP IRQ affinity for a specificprocess by process ID (pid). Use the ps or top command to determine the pid of a process.To determine the SMP IRQ affinity for a running process, use the following command:taskset -p To set the SMP IRQ affinity for a running process:taskset -p To start a process with a specific SMP IRQ affinity:taskset

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!