Skip to content

Instantly share code, notes, and snippets.

@Bartvz
Bartvz / balance-irqs.sh
Created October 17, 2024 15:18
A script to balance IRQs for the Belkin RT3200 running OpenWRT
#!/bin/sh
# Function to set IRQ affinity
set_affinity() {
irq=$1
cpu_mask=$2
# Check if the CPU mask is valid
if echo "$cpu_mask" | grep -qE '^[0-9A-Fa-f]+$'; then
echo "$cpu_mask" > "/proc/irq/$irq/smp_affinity" 2>/dev/null
@Bartvz
Bartvz / balance-irqs.sh
Last active October 17, 2024 15:18
A script to balance IRQs for the Xiaomi AX3000T running OpenWRT
#!/bin/sh
# Function to set IRQ affinity
set_affinity() {
irq=$1
cpu_mask=$2
# Check if the CPU mask is valid
if echo "$cpu_mask" | grep -qE '^[0-9A-Fa-f]+$'; then
echo "$cpu_mask" > "/proc/irq/$irq/smp_affinity" 2>/dev/null