From 4745d1cb0aab9e902d4c481ffc610d9d0609316b Mon Sep 17 00:00:00 2001 From: Yunfeng Ye Date: Tue, 5 Jan 2021 17:31:13 +0800 Subject: [PATCH] Support IRQBALANCE_BANNED_CPULIST env variable The env variable IRQBALANCE_BANNED_CPUS will be discarded, so backport to support IRQBALANCE_BANNED_CPULIST instead. Signed-off-by: Yunfeng Ye --- ...RQBALANCE_BANNED_CPULIST-to-env-file.patch | 39 ++++++++++++++ ...ble-to-ban-cpus-using-cpulist-syntax.patch | 52 +++++++++++++++++++ irqbalance.spec | 11 +++- 3 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 Add-IRQBALANCE_BANNED_CPULIST-to-env-file.patch create mode 100644 add-env-variable-to-ban-cpus-using-cpulist-syntax.patch diff --git a/Add-IRQBALANCE_BANNED_CPULIST-to-env-file.patch b/Add-IRQBALANCE_BANNED_CPULIST-to-env-file.patch new file mode 100644 index 0000000..a15b784 --- /dev/null +++ b/Add-IRQBALANCE_BANNED_CPULIST-to-env-file.patch @@ -0,0 +1,39 @@ +From 31c7d128fd6f083c7395b327f824a0c11d5e380f Mon Sep 17 00:00:00 2001 +From: Yunfeng Ye +Date: Sat, 21 Nov 2020 14:27:28 +0800 +Subject: [PATCH] Add IRQBALANCE_BANNED_CPULIST to env file + +Signed-off-by: Yunfeng Ye +--- + misc/irqbalance.env | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/misc/irqbalance.env b/misc/irqbalance.env +index 23570b2..237e4af 100644 +--- a/misc/irqbalance.env ++++ b/misc/irqbalance.env +@@ -22,6 +22,21 @@ + #IRQBALANCE_BANNED_CPUS= + + # ++# IRQBALANCE_BANNED_CPULIST ++# The CPUs list which allows you to indicate which CPUs should ++# be skipped when reblancing IRQs. CPU numbers in CPUs list will ++# not have any IRQs assigned to them on rebalance. ++# ++# The format of CPUs list is: ++# ,..., ++# or a range: ++# - ++# or a mixture: ++# ,...,- ++# ++#IRQBALANCE_BANNED_CPULIST= ++ ++# + # IRQBALANCE_ARGS + # Append any args here to the irqbalance daemon as documented in the man + # page. +-- +1.8.3.1 + diff --git a/add-env-variable-to-ban-cpus-using-cpulist-syntax.patch b/add-env-variable-to-ban-cpus-using-cpulist-syntax.patch new file mode 100644 index 0000000..408dadc --- /dev/null +++ b/add-env-variable-to-ban-cpus-using-cpulist-syntax.patch @@ -0,0 +1,52 @@ +From 677b686e223c74e64f5b230bdb4079555a5a62a9 Mon Sep 17 00:00:00 2001 +From: ChanderG +Date: Tue, 25 Aug 2020 15:46:56 +0530 +Subject: [PATCH] add env variable to ban cpus using cpulist syntax + +allows banning of cpus using the taskset cpulist syntax in addition to the +bitmap syntax supported via the existing environment variable +IRQBALANCE_BANNED_CPUS + +Signed-off-by: Yunfeng Ye +--- + cputree.c | 6 ++++++ + irqbalance.1 | 6 ++++++ + 2 files changed, 12 insertions(+) + +diff --git a/cputree.c b/cputree.c +index 0433657..00cf47f 100644 +--- a/cputree.c ++++ b/cputree.c +@@ -127,6 +127,12 @@ static void setup_banned_cpus(void) + goto out; + } + ++ env = getenv("IRQBALANCE_BANNED_CPULIST"); ++ if (env && strlen(env)) { ++ cpulist_parse(env, strlen(env), banned_cpus); ++ goto out; ++ } ++ + path = "/sys/devices/system/cpu/isolated"; + process_one_line(path, get_mask_from_cpulist, &isolated_cpus); + +diff --git a/irqbalance.1 b/irqbalance.1 +index 3005f6b..33ffd26 100644 +--- a/irqbalance.1 ++++ b/irqbalance.1 +@@ -158,6 +158,12 @@ Provides a mask of CPUs which irqbalance should ignore and never assign interrup + If not specified, irqbalance use mask of isolated and adaptive-ticks CPUs on the + system as the default value. + ++.TP ++.B IRQBALANCE_BANNED_CPULIST ++Provides a cpulist which irqbalance should ignore and never assign interrupts to. ++If not specified, irqbalance use mask of isolated and adaptive-ticks CPUs on the ++system as the default value. ++ + .SH "SIGNALS" + .TP + .B SIGHUP +-- +1.8.3.1 + diff --git a/irqbalance.spec b/irqbalance.spec index 1af6f48..1eef515 100644 --- a/irqbalance.spec +++ b/irqbalance.spec @@ -1,7 +1,7 @@ Summary: A dynamic adaptive IRQ balancing daemon Name: irqbalance Version: 1.7.0 -Release: 2 +Release: 3 Epoch: 3 License: GPLv2 Source0: https://github.com/Irqbalance/irqbalance/archive/v%{version}.tar.gz#/irqbalance-%{version}.tar.gz @@ -21,6 +21,9 @@ Requires: numactl-libs %define _hardened_build 1 +Patch6000: add-env-variable-to-ban-cpus-using-cpulist-syntax.patch +Patch6001: Add-IRQBALANCE_BANNED_CPULIST-to-env-file.patch + %description Irqbalance is a daemon to help balance the cpu load generated by interrupts across all of a systems cpus. Irqbalance identifies the @@ -77,6 +80,12 @@ fi /sbin/chkconfig --del %{name} >/dev/null 2>&1 || : %changelog +* Tue Jan 15 2021 Yunfeng Ye - 3:1.7.0-3 +- Type:enhanced +- ID:NA +- SUG:restart +- DESC:support IRQBALANCE_BANNED_CPULIST env variable + * Thu Sep 10 2020 Chunsheng Luo - 3:1.7.0-2 - Type:enhanced - ID:NA