Last active
December 23, 2015 23:39
-
-
Save meteozond/6711756 to your computer and use it in GitHub Desktop.
By default all interrupts of multi interrupts network cards are linked to the first core. This script will uniformly spread interrupts between cores.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cores=$(grep -c proc /proc/cpuinfo); | |
irqs=$(grep eth /proc/interrupts | cut -d: -f1) | |
core=$(($cores-1)); | |
for irq in $irqs; do | |
mask=`echo "obase=16; \$[2 ** $core]" | bc`; | |
mkdir -p "/proc/irq/$irq/" | |
echo $core, $irq | |
echo $mask > /proc/irq/$irq/smp_affinity | |
core=$(($core-1)); | |
if [ $core -eq -1 ]; | |
then | |
core=$(($cores-1)); | |
fi | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment