| 1 | #!/bin/bash -e |
| 2 | # |
| 3 | # rc.local |
| 4 | # |
| 5 | # This script is executed at the end of each multiuser runlevel. |
| 6 | # Make sure that the script will "exit 0" on success or any other |
| 7 | # value on error. |
| 8 | # |
| 9 | # In order to enable or disable this script just change the execution |
| 10 | # bits. |
| 11 | # |
| 12 | # By default this script does nothing. |
| 13 | |
| 14 | # distribute interrupt for eth0 on core 1-5 |
| 15 | core=(2 4 8 16 32) |
| 16 | l=0 |
| 17 | for i in $(awk '/eth0/ {sub(/:/, ""); print $1}' /proc/interrupts); do |
| 18 | echo ${core[$l]} > /proc/irq/$i/smp_affinity |
| 19 | let l++ |
| 20 | [ $l -eq 5 ] && l=0 |
| 21 | done |
| 22 | |
| 23 | exit 0 |