irqbalance: activate_mapping: activate only online CPUs
activate_mapping: activate only online CPUs Signed-off-by: qinyu <qinyu32@huawei.com>
This commit is contained in:
parent
fbda8b4f5a
commit
b1a4f44928
56
backport-activate_mapping-activate-only-online-CPUs.patch
Normal file
56
backport-activate_mapping-activate-only-online-CPUs.patch
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
From c8757c6d870c4788da4980abaf21cb7369702ee9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Paride Legovini <paride@debian.org>
|
||||||
|
Date: Tue, 25 Aug 2020 23:18:27 +0200
|
||||||
|
Subject: [PATCH] activate_mapping: activate only online CPUs
|
||||||
|
|
||||||
|
When echoing a mask to /proc/irq/N/smp_affinity make sure to activate
|
||||||
|
only CPUs which are online. Activating a CPU which is not online results
|
||||||
|
in a EOVERFLOW.
|
||||||
|
|
||||||
|
Originally fixed in Debian by Helge Deller <deller@gmx.de>.
|
||||||
|
|
||||||
|
Conflict:NA
|
||||||
|
Reference:https://github.com/Irqbalance/irqbalance/commit/c8757c6d870c4788da4980abaf21cb7369702ee9
|
||||||
|
---
|
||||||
|
activate.c | 8 ++++++--
|
||||||
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/activate.c b/activate.c
|
||||||
|
index 065f880..62cfd08 100644
|
||||||
|
--- a/activate.c
|
||||||
|
+++ b/activate.c
|
||||||
|
@@ -49,6 +49,7 @@ static void activate_mapping(struct irq_info *info, void *data __attribute__((un
|
||||||
|
char buf[PATH_MAX];
|
||||||
|
FILE *file;
|
||||||
|
int ret = 0;
|
||||||
|
+ cpumask_t applied_mask;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* only activate mappings for irqs that have moved
|
||||||
|
@@ -59,10 +60,13 @@ static void activate_mapping(struct irq_info *info, void *data __attribute__((un
|
||||||
|
if (!info->assigned_obj)
|
||||||
|
return;
|
||||||
|
|
||||||
|
+ /* activate only online cpus, otherwise writing to procfs returns EOVERFLOW */
|
||||||
|
+ cpus_and(applied_mask, cpu_online_map, info->assigned_obj->mask);
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* Don't activate anything for which we have an invalid mask
|
||||||
|
*/
|
||||||
|
- if (check_affinity(info, info->assigned_obj->mask))
|
||||||
|
+ if (check_affinity(info, applied_mask))
|
||||||
|
return;
|
||||||
|
|
||||||
|
sprintf(buf, "/proc/irq/%i/smp_affinity", info->irq);
|
||||||
|
@@ -70,7 +74,7 @@ static void activate_mapping(struct irq_info *info, void *data __attribute__((un
|
||||||
|
if (!file)
|
||||||
|
return;
|
||||||
|
|
||||||
|
- cpumask_scnprintf(buf, PATH_MAX, info->assigned_obj->mask);
|
||||||
|
+ cpumask_scnprintf(buf, PATH_MAX, applied_mask);
|
||||||
|
ret = fprintf(file, "%s", buf);
|
||||||
|
if (ret < 0) {
|
||||||
|
log(TO_ALL, LOG_WARNING, "cannot change irq %i's affinity, add it to banned list", info->irq);
|
||||||
|
--
|
||||||
|
2.23.0
|
||||||
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
Summary: A dynamic adaptive IRQ balancing daemon
|
Summary: A dynamic adaptive IRQ balancing daemon
|
||||||
Name: irqbalance
|
Name: irqbalance
|
||||||
Version: 1.7.0
|
Version: 1.7.0
|
||||||
Release: 4
|
Release: 5
|
||||||
Epoch: 3
|
Epoch: 3
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
Source0: https://github.com/Irqbalance/irqbalance/archive/irqbalance-%{version}.tar.gz
|
Source0: https://github.com/Irqbalance/irqbalance/archive/irqbalance-%{version}.tar.gz
|
||||||
@ -22,6 +22,7 @@ Requires: numactl-libs
|
|||||||
%define _hardened_build 1
|
%define _hardened_build 1
|
||||||
|
|
||||||
Patch6000: fix-unsigned-integer-subtraction-sign-overflow.patch
|
Patch6000: fix-unsigned-integer-subtraction-sign-overflow.patch
|
||||||
|
Patch6001: backport-activate_mapping-activate-only-online-CPUs.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Irqbalance is a daemon to help balance the cpu load generated by
|
Irqbalance is a daemon to help balance the cpu load generated by
|
||||||
@ -79,6 +80,12 @@ fi
|
|||||||
/sbin/chkconfig --del %{name} >/dev/null 2>&1 || :
|
/sbin/chkconfig --del %{name} >/dev/null 2>&1 || :
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jan 5 2023 qinyu <qinyu32@huawei.com> - 3:1.7.0-5
|
||||||
|
- Type:bugfix
|
||||||
|
- ID:NA
|
||||||
|
- SUG:restart
|
||||||
|
- DESC: activate_mapping: activate only online CPUs
|
||||||
|
|
||||||
* Wed Aug 25 2021 Liu Chao <liuchao173@huawei.com> - 3:1.7.0-4
|
* Wed Aug 25 2021 Liu Chao <liuchao173@huawei.com> - 3:1.7.0-4
|
||||||
- Type:bugfix
|
- Type:bugfix
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user