set irq for eth0 on core 1, 2, 3, 4 and 5 to reduce load on core 0
authorLaurent Mazet <laurent.mazet@thalesgroup.com>
Wed, 14 Jan 2015 14:12:22 +0000 (15:12 +0100)
committerLaurent Mazet <laurent.mazet@thalesgroup.com>
Wed, 14 Jan 2015 14:12:22 +0000 (15:12 +0100)
master/opt/cluster/acq/etc/rc.local [new file with mode: 0755]

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