From b7a99b2334e6c69615dc34f93015b8c3ace382c2 Mon Sep 17 00:00:00 2001 From: Marc Benoit Date: Sun, 23 Feb 2020 17:53:11 -0500 Subject: [PATCH] irqbalance: add support of interval and banirq Added the ability to change sampling interval and provide a list of IRQ's to ignore via /etc/config/irqbalance Signed-off-by: Marc Benoit --- utils/irqbalance/Makefile | 2 +- utils/irqbalance/files/irqbalance.config | 7 +++++++ utils/irqbalance/files/irqbalance.init | 13 ++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/utils/irqbalance/Makefile b/utils/irqbalance/Makefile index 19116c63b..a0ebac2da 100644 --- a/utils/irqbalance/Makefile +++ b/utils/irqbalance/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=irqbalance PKG_VERSION:=1.6.0 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_PROTO:=git diff --git a/utils/irqbalance/files/irqbalance.config b/utils/irqbalance/files/irqbalance.config index 5f074b00f..cc9382d61 100644 --- a/utils/irqbalance/files/irqbalance.config +++ b/utils/irqbalance/files/irqbalance.config @@ -1,3 +1,10 @@ config irqbalance 'irqbalance' option enabled '0' + # The default value is 10 seconds + #option interval '10' + + # List of IRQ's to ignore + #list banirq '36' + #list banirq '69' + diff --git a/utils/irqbalance/files/irqbalance.init b/utils/irqbalance/files/irqbalance.init index e794b7365..3f968d075 100644 --- a/utils/irqbalance/files/irqbalance.init +++ b/utils/irqbalance/files/irqbalance.init @@ -9,8 +9,19 @@ start_service() { config_get_bool enabled irqbalance enabled 0 [ "$enabled" -gt 0 ] || return 0 + # 10 is the default + config_get interval irqbalance interval 10 + + # A list of IRQ's to ignore + banirq="" + handle_banirq_value() + { + banirq="$banirq -i $1" + } + config_list_foreach irqbalance banirq handle_banirq_value + procd_open_instance "irqbalance" - procd_set_param command /usr/sbin/irqbalance -f + procd_set_param command /usr/sbin/irqbalance -f -t "$interval" "$banirq" procd_set_param respawn procd_close_instance }