irqbalance/add-env-variable-to-ban-cpus-using-cpulist-syntax.patch
Yunfeng Ye 4745d1cb0a 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 <yeyunfeng@huawei.com>
2021-01-05 17:34:24 +08:00

53 lines
1.5 KiB
Diff

From 677b686e223c74e64f5b230bdb4079555a5a62a9 Mon Sep 17 00:00:00 2001
From: ChanderG <mail@chandergovind.org>
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 <yeyunfeng@huawei.com>
---
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