Debian – Making a IRQ SMP Affinity change permanent

debianinterruptsmp

I have to change the smp_affinity of a interrupt permanently. The following code needs to be executed when the server reboots:

echo "1" > /proc/irq/152/smp_affinity_list
echo "2" > /proc/irq/151/smp_affinity_list
echo "3" > /proc/irq/150/smp_affinity_list
echo "4" > /proc/irq/149/smp_affinity_list
echo "5" > /proc/irq/148/smp_affinity_list
echo "6" > /proc/irq/147/smp_affinity_list
echo "7" > /proc/irq/146/smp_affinity_list
echo "8" > /proc/irq/145/smp_affinity_list
echo "9" > /proc/irq/144/smp_affinity_list
echo "10" > /proc/irq/143/smp_affinity_list
echo "11" > /proc/irq/142/smp_affinity_list
echo "12" > /proc/irq/141/smp_affinity_list
echo "13" > /proc/irq/140/smp_affinity_list
echo "14" > /proc/irq/139/smp_affinity_list
echo "15" > /proc/irq/138/smp_affinity_list
echo "16" > /proc/irq/137/smp_affinity_list

I've added these lines to the /etc/rc.local file but the changes are not applied to the system. I've also added echo "test" > /root/test which gets executed properly, so the rc.local file gets executed. The system is running Debian 6.0.

Best Answer

The rc.local script should be the last executed on boot. Let's supposed it not running as last in your system, then it might run too early, before /proc is even mounted. Or it might be a problem on your modular kernel if the smp_affinity_list is managed by a kernel module still not loaded when rc.local is run.

So, just change your rc.local and check for the existance of /proc/irq/*/smp_affinity_list before echoing into it. Otherwise sleep for some time and try again and eventually emit an error message via the logger command, so that you will be able to read it in /var/log/syslog.

Related Question