| 116 | == распределение прерывания по ядром с помощью `irq affinity` |
| 117 | {{{#!bash |
| 118 | #!/usr/bin/env bash |
| 119 | cpu=`/bin/grep processor /proc/cpuinfo | wc -l` |
| 120 | c=0 |
| 121 | for dir in rx tx; do |
| 122 | for eth in 0 1; do |
| 123 | for i in `seq 0 22`; do |
| 124 | irq=`/bin/grep "eth${eth}-${dir}-${i}$" /proc/interrupts | |
| 125 | awk -F : '{print $1}' | |
| 126 | sed -e 's/ //g'` |
| 127 | if [[ "x${irq}" == "x" ]]; then |
| 128 | continue |
| 129 | fi |
| 130 | mask="$((1<<($c+0)))" |
| 131 | echo mask: $mask, cpu: $c, irq: $irq |
| 132 | printf "%x\n" $mask >/proc/irq/$irq/smp_affinity |
| 133 | c=$((c+1)) |
| 134 | if [[ $c -gt $cpu ]]; then |
| 135 | c=0 |
| 136 | fi |
| 137 | done |
| 138 | done |
| 139 | done |
| 140 | }}} |
| 141 | |
| 142 | [[br]] |
| 143 | |