set irq for eth0 on core 1, 2, 3, 4 and 5 to reduce load on core 0
[debian6500.git] / master / opt / cluster / acq / etc / rc.local
diff --git a/master/opt/cluster/acq/etc/rc.local b/master/opt/cluster/acq/etc/rc.local
new file mode 100755 (executable)
index 0000000..fd73c36
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash -e
+#
+# rc.local
+#
+# This script is executed at the end of each multiuser runlevel.
+# Make sure that the script will "exit 0" on success or any other
+# value on error.
+#
+# In order to enable or disable this script just change the execution
+# bits.
+#
+# By default this script does nothing.
+
+# distribute interrupt for eth0 on core 1-5
+core=(2 4 8 16 32)
+l=0
+for i in $(awk '/eth0/ {sub(/:/, ""); print $1}' /proc/interrupts); do
+  echo ${core[$l]} > /proc/irq/$i/smp_affinity
+  let l++
+  [ $l -eq 5 ] && l=0
+done
+
+exit 0