Skip to content

Instantly share code, notes, and snippets.

@meteozond meteozond/eth_int_balance
Last active Dec 23, 2015

Embed
What would you like to do?
By default all interrupts of multi interrupts network cards are linked to the first core. This script will uniformly spread interrupts between cores.
#!/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
You can’t perform that action at this time.