7 Star 0 Fork 18

src-openEuler/irqbalance

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
feature-add-new-irq-migrate-rule-to-avoid-high-cpu-i.patch 3.16 KB
一键复制 编辑 原始数据 按行查看 历史
yuq 提交于 2023-01-17 09:43 . irqbalance: upgrade irqbalance to v1.9.2
From 84a2df1c9962a87f55e1c0d3bd2118fd754a4b48 Mon Sep 17 00:00:00 2001
From: hejingxian <[email protected]>
Date: Fri, 3 Jan 2020 16:43:28 +0800
Subject: [PATCH] feature: add new irq migrate rule to avoid high cpu irq load
By the old irq migrate rule, the irqs cannot be moved if the adjustment_load will become smaller then
the min_load after moving irq. However, we can accept that the delta load become smaller after moving irq.
---
irqbalance.c | 8 +++++++-
irqbalance.h | 1 +
irqlist.c | 6 +++++-
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/irqbalance.c b/irqbalance.c
index de7f4e4..ee2c988 100644
--- a/irqbalance.c
+++ b/irqbalance.c
@@ -71,6 +71,7 @@ GMainLoop *main_loop;
char *cpu_ban_string = NULL;
unsigned long migrate_ratio = 0;
+unsigned long load_limit = 0;
#ifdef HAVE_IRQBALANCEUI
int socket_fd;
@@ -111,6 +112,7 @@ struct option lopts[] = {
{"hintpolicy", 1, NULL, 'h'},
{"verifyhint", 1, NULL, 'v'},
{"notclearhint", 0, NULL, 'n'},
+ {"loadlimit", 1, NULL, 'g'},
{0, 0, 0, 0}
};
@@ -120,6 +122,7 @@ static void usage(void)
log(TO_CONSOLE, LOG_INFO, " [--powerthresh= | -p <off> | <n>] [--banirq= | -i <n>] [--banmod= | -m <module>] [--policyscript= | -l <script>]\n");
log(TO_CONSOLE, LOG_INFO, " [--pid= | -s <file>] [--deepestcache= | -c <n>] [--interval= | -t <n>] [--migrateval= | -e <n>]\n");
log(TO_CONSOLE, LOG_INFO, " [--rulesconfig= | -r <config>] [--hintpolicy | -h <subset>] [--verifyhint= | -v n] [--notclearhint | -n]\n");
+ log(TO_CONSOLE, LOG_INFO, " [--loadlimit= | -g <n>]\n");
}
static void version(void)
@@ -135,7 +138,7 @@ static void parse_command_line(int argc, char **argv)
char *endptr;
while ((opt = getopt_long(argc, argv,
- "odfjVni:p:s:c:l:m:t:e:r:h:v:",
+ "odfjVni:p:s:c:l:m:t:e:r:h:v:g:",
lopts, &longind)) != -1) {
switch(opt) {
@@ -233,6 +236,9 @@ static void parse_command_line(int argc, char **argv)
case 'n':
clear_affinity_hint = 0;
break;
+ case 'g':
+ load_limit = strtoul(optarg, NULL, 10);
+ break;
}
}
}
diff --git a/irqbalance.h b/irqbalance.h
index 710d496..e8f9fba 100644
--- a/irqbalance.h
+++ b/irqbalance.h
@@ -83,6 +83,7 @@ extern cpumask_t banned_cpus;
extern cpumask_t unbanned_cpus;
extern long HZ;
extern unsigned long migrate_ratio;
+extern unsigned long load_limit;
/*
* Numa node access routines
diff --git a/irqlist.c b/irqlist.c
index 4dd4a83..be51c0f 100644
--- a/irqlist.c
+++ b/irqlist.c
@@ -97,7 +97,11 @@ static void move_candidate_irqs(struct irq_info *info, void *data)
}
/* If we can migrate an irq without swapping the imbalance do it. */
- if ((lb_info->min_load + info->load) < delta_load + (lb_info->adjustment_load - info->load)) {
+ if ((lb_info->adjustment_load - info->load) > (lb_info->min_load + info->load)) {
+ lb_info->adjustment_load -= info->load;
+ lb_info->min_load += info->load;
+ } else if (delta_load && load_limit && (lb_info->adjustment_load > load_limit) &&
+ (lb_info->min_load + info->load) < (lb_info->adjustment_load - info->load) + delta_load) {
lb_info->adjustment_load -= info->load;
lb_info->min_load += info->load;
if (lb_info->min_load > lb_info->adjustment_load) {
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/irqbalance.git
[email protected]:src-openeuler/irqbalance.git
src-openeuler
irqbalance
irqbalance
master

搜索帮助