Dynalink DL-WRX36 Askey RT5010W IPQ8072A technical discussion

Very close to your solution, but distributes all interrupts except for ce* (changing affinity on these will crash the wifi firmware) and arch* (these are spread around correctly already).
I put this script as a service in /etc/init.d/irqbalance-manual and enable it (service irqbalance-manual enable):

#!/bin/sh /etc/rc.common

START=13
USE_PROCD=1
AFFINITY_MIN=2
AFFINITY_MAX=8
AFFINITY_ALL="$(printf %x $(( AFFINITY_MAX * 2 - 1 )))"

set_affinities() {
	local callback="$1" irq desc ret=0
	sed -nre 's!^[[:space:]]*([0-9]+):[[:space:]]+.*[[:space:]]GIC-0[[:space:]]+[0-9]+[[:space:]]+(Level|Edge)[[:space:]]+(.+)$!\1 \3! p' /proc/interrupts | \
	while read irq desc
  	do
		case "$desc" in
			arch*)	;;
			ce*)	;;
			*)	"$callback" "/proc/irq/$irq/smp_affinity" || ret=1 ;;
		esac
	done
	return $ret
}

set_affinity_per_cpu() {
	local procfile="$1" ret=0
	echo "$AFFINITY" > "$procfile" || ret=$?
	if [ $AFFINITY -ge $AFFINITY_MAX ]
	then
		AFFINITY=$AFFINITY_MIN
	else
		AFFINITY=$(( AFFINITY * 2 ))
	fi
	return $ret
}

set_affinity_shared() {
	local procfile="$1" ret=0
	echo "$AFFINITY_ALL" > "$procfile" || ret=$?
	return $ret
}

start_service() {
	reload
}

reload_service() {
	AFFINITY=$AFFINITY_MIN
	set_affinities set_affinity_per_cpu
}

stop_service() {
	set_affinities set_affinity_shared
}

/proc/interrupts:

           CPU0       CPU1       CPU2       CPU3       
  9:          0          0          0          0     GIC-0  39 Level     arch_mem_timer
 13:    6599565    6186415    7471758   16583578     GIC-0  20 Level     arch_timer
 16:          2          0          0          0     GIC-0 354 Edge      smp2p
 17:          0          0          0          0     GIC-0 216 Level     4a9000.thermal-sensor
 18:          0          0          0          0     GIC-0 239 Level     bam_dma
 21:          0          0          0          0     GIC-0 270 Level     bam_dma
 22:          5          0          0          0     GIC-0 340 Level     msm_serial0
 23:      35107          0          0     110212     GIC-0 178 Level     bam_dma
 24:          0          0          0          0     GIC-0  35 Edge      wdt_bark
 25:          0          0          0          0     GIC-0 357 Edge      q6v5 wdog
 29:          5          0          0          0     GIC-0 348 Edge      ce0
 30:   12446392          0          0          0     GIC-0 347 Edge      ce1
 31:   18653030          0          0          0     GIC-0 346 Edge      ce2
 32:     473055          0          0          0     GIC-0 343 Edge      ce3
 34:          0          0          0          0     GIC-0 443 Edge      ce5
 36:     677883          0          0          0     GIC-0  72 Edge      ce7
 38:          0          0          0          0     GIC-0 334 Edge      ce9
 39:          0          0          0          0     GIC-0 333 Edge      ce10
 40:          0          0          0          0     GIC-0  69 Edge      ce11
 47:          0          0          0          0     GIC-0 323 Edge      reo2ost-exception
 48:          0     187429          0          0     GIC-0 322 Edge      wbm2host-rx-release
 49:          0          0        577          0     GIC-0 321 Edge      reo2host-status
 50:          0          0          0     327051     GIC-0 320 Edge      reo2host-destination-ring4
 51:          0     219132          0          0     GIC-0 271 Edge      reo2host-destination-ring3
 52:          0          0     226751          0     GIC-0 268 Edge      reo2host-destination-ring2
 53:          0          0          0    2003466     GIC-0 267 Edge      reo2host-destination-ring1
 57:          2   13640697          0          0     GIC-0 263 Edge      ppdu-end-interrupts-mac3
 58:          0          0          0          0     GIC-0 262 Edge      ppdu-end-interrupts-mac2
 59:          3          0          0    7853447     GIC-0 261 Edge      ppdu-end-interrupts-mac1
 60:          1          0          0          0     GIC-0 260 Edge      rxdma2host-monitor-status-ring-mac3
 61:          0          0          0          0     GIC-0 256 Edge      rxdma2host-monitor-status-ring-mac2
 62:          1          0          0          0     GIC-0 255 Edge      rxdma2host-monitor-status-ring-mac1
 63:          1          0          0          0     GIC-0 235 Edge      host2rxdma-host-buf-ring-mac3
 64:          0          0          0          0     GIC-0 215 Edge      host2rxdma-host-buf-ring-mac2
 65:          0          0          0          0     GIC-0 212 Edge      host2rxdma-host-buf-ring-mac1
 66:          0          0          0          0     GIC-0 211 Edge      rxdma2host-destination-ring-mac3
 67:          0          0          0          0     GIC-0 210 Edge      rxdma2host-destination-ring-mac2
 68:          0          0          0          0     GIC-0 209 Edge      rxdma2host-destination-ring-mac1
 73:          0      54076          0          0     GIC-0 191 Edge      wbm2host-tx-completions-ring3
 74:          0          0    1571553          0     GIC-0 190 Edge      wbm2host-tx-completions-ring2
 75:          0          0          0      13208     GIC-0 189 Edge      wbm2host-tx-completions-ring1
 77:         16          0          0          0     GIC-0  47 Edge      cpr3
 78:          0          0    4790717          0     GIC-0 377 Level     edma_txcmpl
 79:          0          0          0          0     GIC-0 385 Level     edma_rxfill
 80:          0    5254738          0          0     GIC-0 393 Level     edma_rxdesc
 81:          0          0          0          0     GIC-0 376 Level     edma_misc
 82:          0          0          0          0  pmic_arb 51380237 Edge      pm-adc5
 83:          0          0          0          0     smp2p   0 Edge      q6v5 fatal
 84:          1          0          0          0     smp2p   1 Edge      q6v5 ready
 85:          0          0          0          0     smp2p   2 Edge      q6v5 handover
 86:          0          0          0          0     smp2p   3 Edge      q6v5 stop
 87:          0          0          0          0   msmgpio  34 Edge      keys
 88:          0          0          0          0   msmgpio  63 Edge      keys
 89:          0          0          0          0     GIC-0 172 Level     xhci-hcd:usb1
 90:         63          0          0          0     GIC-0 353 Edge      glink-native
IPI0:      9552       5659      11830      13262       Rescheduling interrupts
IPI1:   6229227   11523719   10657244    2664602       Function call interrupts
IPI2:         0          0          0          0       CPU stop interrupts
IPI3:         0          0          0          0       CPU stop (for crash dump) interrupts
IPI4:         0          0          0          0       Timer broadcast interrupts
IPI5:      4397      11996       6132       5917       IRQ work interrupts
IPI6:         0          0          0          0       CPU wake-up interrupts
Err:          0
2 Likes