7 Star 0 Fork 18

src-openEuler/irqbalance

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Avoid-repeated-affinity-checks-when-no-change-is-nec.patch 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
pan-y 提交于 2024-03-26 20:40 . backport community patches
From b4c377148dda6f10a5c25be535513eeab236141f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <[email protected]>
Date: Wed, 13 Dec 2023 20:09:34 +0100
Subject: [PATCH] Avoid repeated affinity checks when no change is necessary
An IRQ may be migrated several times during one loop iteration, and end
up with the same CPU affinity mask as before - the "moved" flag is merely
a hint a affinity change may be necessary. This notably also happens
during initial placement, but may happen also anytime later.
To avoid visiting each IRQ again and again unset the "moved" flag. This
avoids the open/stat/read/close syscalls for unchanged interrupts.
Fixes: #285
Reference: https://github.com/Irqbalance/irqbalance/commit/b4c377148dda6f10a5c25be535513eeab236141f
Conflict: NA
---
activate.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/activate.c b/activate.c
index 4830f34..724fbd5 100644
--- a/activate.c
+++ b/activate.c
@@ -68,8 +68,10 @@ static void activate_mapping(struct irq_info *info, void *data __attribute__((un
/*
* Don't activate anything for which we have an invalid mask
*/
- if (check_affinity(info, applied_mask))
+ if (check_affinity(info, applied_mask)) {
+ info->moved = 0; /* nothing to do, mark as done */
return;
+ }
sprintf(buf, "/proc/irq/%i/smp_affinity", info->irq);
file = fopen(buf, "w");
--
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

搜索帮助