代码拉取完成,页面将自动刷新
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。