1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-13 10:59:13 +02:00
openwrt-packages/utils/irqbalance/files/irqbalance.init
krant 41e5b979f5 irqbalance Update init script to remove duplicate spaces
I have some strange issues with irqbalance sometimes overwritin
smp_affinity values for banned/ignored IRQs. The issue is reproduceable
and is mitigated when I change theway how the irqbalance command line is
built. The only difference between the resulting command is that there
is only one space between the -t parameter and the first -i parameter
value.

Also see https://github.com/Irqbalance/irqbalance/issues/297

Signed-off-by: Carsten Schuette <schuettecarsten@googlemail.com>
2024-03-07 16:48:05 +02:00

52 lines
1.1 KiB
Bash

#!/bin/sh /etc/rc.common
START=90
STOP=10
USE_PROCD=1
service_triggers()
{
procd_add_reload_trigger "irqbalance"
}
start_service() {
local enabled
config_load 'irqbalance'
config_get_bool enabled irqbalance enabled 0
[ "$enabled" -gt 0 ] || return 0
config_get deepestcache irqbalance deepestcache 2
config_get interval irqbalance interval 10
config_get banned_cpulist irqbalance banned_cpulist ''
config_get debug irqbalance debug 0
procd_open_instance "irqbalance"
if [ -n "$banned_cpulist" ]; then
procd_set_param env IRQBALANCE_BANNED_CPULIST="$banned_cpulist"
fi
procd_add_jail_mount_rw /proc
procd_set_param command /usr/sbin/irqbalance
procd_append_param command -f
procd_append_param command "-c $deepestcache"
procd_append_param command "-t $interval"
# add banned IRQs
handle_banirq_value()
{
procd_append_param command "-i $1"
}
config_list_foreach irqbalance banirq handle_banirq_value
# debug
if [ "$debug" -gt 0 ]; then
procd_append_param command -d
procd_set_param stdout 1
fi
procd_set_param stderr 1
procd_set_param respawn
procd_close_instance
}