|
| 1 | +#!/usr/bin/bash |
| 2 | +# |
| 3 | +# This script pins iwlwifi and enp1 to cores 0-1 |
| 4 | +# |
| 5 | +# https://www.kernel.org/doc/Documentation/IRQ-affinity.txt |
| 6 | +# https://linux-kernel-labs.github.io/refs/heads/master/lectures/interrupts.html#interrupt-handling-in-linux |
| 7 | +# in future consider |
| 8 | +# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/performance_tuning_guide/network-rps |
| 9 | + |
| 10 | +# [das@hp0:~]$ cat /proc/interrupts | grep wifi |
| 11 | +# 86: 0 0 0 4361163 0 0 0 0 IR-PCI-MSIX-0000:03:00.0 0-edge iwlwifi:default_queue |
| 12 | +# 87: 527141 0 0 0 0 0 0 0 IR-PCI-MSIX-0000:03:00.0 1-edge iwlwifi:queue_1 |
| 13 | +# 88: 0 36601 0 0 0 0 0 0 IR-PCI-MSIX-0000:03:00.0 2-edge iwlwifi:queue_2 |
| 14 | +# 89: 0 0 549109 0 0 0 0 0 IR-PCI-MSIX-0000:03:00.0 3-edge iwlwifi:queue_3 |
| 15 | +# 90: 0 0 0 393223 0 0 0 0 IR-PCI-MSIX-0000:03:00.0 4-edge iwlwifi:queue_4 |
| 16 | +# 91: 0 0 0 0 1776763 0 0 0 IR-PCI-MSIX-0000:03:00.0 5-edge iwlwifi:queue_5 |
| 17 | +# 92: 0 0 0 0 0 159677 0 0 IR-PCI-MSIX-0000:03:00.0 6-edge iwlwifi:queue_6 |
| 18 | +# 93: 0 0 0 0 0 0 295033 0 IR-PCI-MSIX-0000:03:00.0 7-edge iwlwifi:queue_7 |
| 19 | +# 94: 0 0 0 0 0 0 0 642178 IR-PCI-MSIX-0000:03:00.0 8-edge iwlwifi:queue_8 |
| 20 | +# 95: 0 0 0 0 3 0 0 0 IR-PCI-MSIX-0000:03:00.0 9-edge iwlwifi:exception |
| 21 | +# grep iwlwifi /proc/interrupts | awk '{ print $1 }' | sed -e 's/://' |
| 22 | + |
| 23 | +echo "starting to pin" |
| 24 | +echo "BEFORE" |
| 25 | +echo "grep iwlwifi /proc/interrupts" |
| 26 | +grep iwlwifi /proc/interrupts |
| 27 | + |
| 28 | +for i in {86..95} |
| 29 | +do |
| 30 | + echo "Loop:${i}" |
| 31 | + echo "echo 0-1 > /proc/irq/${i}/smp_affinity_list" |
| 32 | + echo 0-1 > /proc/irq/"${i}"/smp_affinity_list |
| 33 | + echo "cat /proc/irq/${i}/smp_affinity_list" |
| 34 | + cat /proc/irq/"${i}"/smp_affinity_list |
| 35 | +done |
| 36 | + |
| 37 | +echo "AFTER" |
| 38 | +echo "grep iwlwifi /proc/interrupts" |
| 39 | +grep iwlwifi /proc/interrupts |
| 40 | + |
| 41 | +#[das@hp0:~]$ grep eno /proc/interrupts |
| 42 | +# 83: 0 0 0 0 0 0 0 0 IR-PCI-MSIX-0000:05:00.0 0-edge eno1 |
| 43 | + |
| 44 | +echo "echo 0-1 > /proc/irq/83/smp_affinity_list" |
| 45 | +echo 0-1 > /proc/irq/83/smp_affinity_list |
0 commit comments