7 Star 0 Fork 18

src-openEuler/irqbalance

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-0004-activate_mapping-only-blacklist-irq-if-error-is-cons.patch 1.87 KB
一键复制 编辑 原始数据 按行查看 历史
pan-y 提交于 2024-03-26 20:40 . backport community patches
From eee7917ef5272691b9d4ee6341463f3c78f7f909 Mon Sep 17 00:00:00 2001
From: Robin Jarry <[email protected]>
Date: Wed, 12 Jul 2023 17:49:13 +0200
Subject: [PATCH] activate_mapping: only blacklist irq if error is considered
permanent
Reference: https://github.com/Irqbalance/irqbalance/commit/eee7917ef5272691b9d4ee6341463f3c78f7f909
Conflict: NA
Some errors reported when writing to smp_affinity are transient. For
example, when a CPU interrupt controller does not have enough room to
map the IRQ, the kernel will return "No space left on device".
This kind of situation can change over time. Do not mark the IRQ
affinity as "unmanaged". Let irqbalance try again later.
Signed-off-by: Robin Jarry <[email protected]>
---
activate.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/activate.c b/activate.c
index 4418cda..7353692 100644
--- a/activate.c
+++ b/activate.c
@@ -91,9 +91,23 @@ static void activate_mapping(struct irq_info *info, void *data __attribute__((un
info->moved = 0; /*migration is done*/
error:
log(TO_ALL, LOG_WARNING,
- "Cannot change IRQ %i affinity: %s. Will never try again.\n",
+ "Cannot change IRQ %i affinity: %s\n",
info->irq, strerror(errsave));
- info->flags |= IRQ_FLAG_AFFINITY_UNMANAGED;
+ switch (errsave) {
+ case ENOSPC: /* Specified CPU APIC is full. */
+ case EAGAIN: /* Interrupted by signal. */
+ case EBUSY: /* Affinity change already in progress. */
+ case EINVAL: /* IRQ would be bound to no CPU. */
+ case ERANGE: /* CPU in mask is offline. */
+ case ENOMEM: /* Kernel cannot allocate CPU mask. */
+ /* Do not blacklist the IRQ on transient errors. */
+ break;
+ default:
+ /* Any other error is considered permanent. */
+ info->flags |= IRQ_FLAG_AFFINITY_UNMANAGED;
+ log(TO_ALL, LOG_WARNING, "IRQ %i affinity is now unmanaged\n",
+ info->irq);
+ }
}
void activate_mappings(void)
--
2.28.0.windows.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/irqbalance.git
[email protected]:src-openeuler/irqbalance.git
src-openeuler
irqbalance
irqbalance
master

搜索帮助