From 1122bf0dd7cad68d12d7931997bb4a31a769a217 Mon Sep 17 00:00:00 2001 From: SuperSix173 Date: Thu, 11 Nov 2021 11:36:29 +0800 Subject: [PATCH] remove feature patches --- ...endir-fails-in-check_platform_device.patch | 52 -- ...name-in-add_new_irq-to-avoid-segment.patch | 81 --- ...add-the-regular-to-get-the-correct-i.patch | 93 --- ...ity-to-set-hintpolicy-during-runtime.patch | 34 - ...irq-migrate-rule-to-avoid-high-cpu-i.patch | 92 --- ...-add-new-user-irq-policy-config-rule.patch | 387 ---------- ...re-add-switch-to-clear-affinity-hint.patch | 105 --- feature-add-the-switch-of-printing-log.patch | 100 --- ...rqbalance-to-link-with-multiple-clie.patch | 39 - ...mpile-the-functions-in-irqbalance-ui.patch | 678 ------------------ ...e-verifyhint-to-detect-hint-variatio.patch | 468 ------------ irqbalance.spec | 47 +- 12 files changed, 7 insertions(+), 2169 deletions(-) delete mode 100644 bugfix-fix-opendir-fails-in-check_platform_device.patch delete mode 100644 bugfix-set-hint-name-in-add_new_irq-to-avoid-segment.patch delete mode 100644 feature-aarch64-add-the-regular-to-get-the-correct-i.patch delete mode 100644 feature-add-ability-to-set-hintpolicy-during-runtime.patch delete mode 100644 feature-add-new-irq-migrate-rule-to-avoid-high-cpu-i.patch delete mode 100644 feature-add-new-user-irq-policy-config-rule.patch delete mode 100644 feature-add-switch-to-clear-affinity-hint.patch delete mode 100644 feature-add-the-switch-of-printing-log.patch delete mode 100644 feature-enable-irqbalance-to-link-with-multiple-clie.patch delete mode 100644 feature-encapsulate-and-compile-the-functions-in-irqbalance-ui.patch delete mode 100644 feature-introduce-verifyhint-to-detect-hint-variatio.patch diff --git a/bugfix-fix-opendir-fails-in-check_platform_device.patch b/bugfix-fix-opendir-fails-in-check_platform_device.patch deleted file mode 100644 index a614fe5..0000000 --- a/bugfix-fix-opendir-fails-in-check_platform_device.patch +++ /dev/null @@ -1,52 +0,0 @@ -From a9f0290a6754a475eb95818dd38dc401370da071 Mon Sep 17 00:00:00 2001 -From: liuchao173 <55137861+liuchao173@users.noreply.github.com> -Date: Mon, 23 Aug 2021 19:40:41 +0800 -Subject: [PATCH] fix opendir fails in check_platform_device - -When irq name does not contain spaces, savedptr is an empty string and irq_fullname will have a extra space at the end like " -LNRO0005:00 ". -So opendir in check_platform_device will fail, and irqbalance prints log: -"No directory /sys/devices/platform/LNRO0005:00 /: No such file or directory" ---- - procinterrupts.c | 25 +++++++++++-------------- - 1 file changed, 11 insertions(+), 14 deletions(-) - -diff --git a/procinterrupts.c b/procinterrupts.c -index 32c5e53..2bd201b 100644 ---- a/procinterrupts.c -+++ b/procinterrupts.c -@@ -183,20 +183,17 @@ void init_irq_class_and_type(char *savedline, struct irq_info *info, int irq) - } - - #ifdef AARCH64 -- irq_name = last_token; -- tmp = strchr(irq_name, '\n'); -- if (tmp) -- *tmp = 0; -- -- if (strlen(irq_name) + strlen(savedptr) + 1 < PATH_MAX) { -- strcat(irq_fullname, irq_name); -- strcat(irq_fullname, " "); -- strcat(irq_fullname, savedptr); -- tmp = strchr(irq_fullname, '\n'); -- if (tmp) -- *tmp = 0; -- } else { -- irq_fullname_valid = 0; -+ if (strlen(savedptr) > 0) { -+ if (strlen(irq_name) + strlen(savedptr) + 1 < PATH_MAX) { -+ strcat(irq_fullname, irq_name); -+ strcat(irq_fullname, " "); -+ strcat(irq_fullname, savedptr); -+ tmp = strchr(irq_fullname, '\n'); -+ if (tmp) -+ *tmp = 0; -+ } else { -+ irq_fullname_valid = 0; -+ } - } - #endif - irq_mod = last_token; --- -1.8.3.1 - diff --git a/bugfix-set-hint-name-in-add_new_irq-to-avoid-segment.patch b/bugfix-set-hint-name-in-add_new_irq-to-avoid-segment.patch deleted file mode 100644 index 3021594..0000000 --- a/bugfix-set-hint-name-in-add_new_irq-to-avoid-segment.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 6f0ea91bfa9ee3016abf694e6fb9f46e7c847cc1 Mon Sep 17 00:00:00 2001 -From: SuperSix173 -Date: Mon, 1 Nov 2021 11:40:39 +0800 -Subject: [PATCH] bugfix: set hint->name in add_new_irq to avoid segmentation - fault - -hint->name is uninitialized in add_new_irq, so segmentation fault occurs -when calling strstr in get_usr_irq_policy - -Signed-off-by: SuperSix173 ---- - classify.c | 14 +++++++++++++- - 1 file changed, 13 insertions(+), 1 deletion(-) - -diff --git a/classify.c b/classify.c -index c5a2a35..560e932 100644 ---- a/classify.c -+++ b/classify.c -@@ -607,6 +607,7 @@ static void add_new_irq(char *path, struct irq_info *hint, GList *proc_interrupt - struct irq_info *new; - struct user_irq_policy pol; - int irq = hint->irq; -+ GList *entry; - - new = get_irq_info(irq); - if (new) -@@ -620,6 +621,11 @@ static void add_new_irq(char *path, struct irq_info *hint, GList *proc_interrupt - __add_banned_irq(irq, &banned_irqs); - new = get_irq_info(irq); - } else { -+ if (!hint->name) { -+ entry = g_list_find_custom(proc_interrupts, hint, compare_ints); -+ if (entry) -+ hint->name = ((struct irq_info *)entry->data)->name; -+ } - new = add_one_irq_to_db(path, hint, &pol); - if ((new != NULL) && (user_policy_list != NULL)) { - set_usr_irq_policy(hint->name, new); -@@ -660,6 +666,7 @@ static void build_one_dev_entry(const char *dirname, GList *tmp_irqs, int build_ - if (irqnum && ((build_irq < 0) || (irqnum == build_irq))) { - hint.irq = irqnum; - hint.type = IRQ_TYPE_MSIX; -+ hint.name = NULL; - add_new_irq(devpath, &hint, tmp_irqs); - if (build_irq >= 0) { - log(TO_CONSOLE, LOG_INFO, "Hotplug dev irq: %d finished.\n", irqnum); -@@ -688,6 +695,7 @@ static void build_one_dev_entry(const char *dirname, GList *tmp_irqs, int build_ - if ((build_irq < 0) || (irqnum == build_irq)) { - hint.irq = irqnum; - hint.type = IRQ_TYPE_LEGACY; -+ hint.name = NULL; - add_new_irq(devpath, &hint, tmp_irqs); - if (build_irq >= 0) - log(TO_CONSOLE, LOG_INFO, "Hotplug dev irq: %d finished.\n", irqnum); -@@ -764,11 +772,13 @@ static struct irq_info * build_dev_irqs(GList *tmp_irqs, int build_irq) - int proc_irq_hotplug(char *savedline, int irq, struct irq_info **pinfo) - { - struct irq_info tmp_info = {0}; -+ GList *tmp_list = NULL; - - /* firstly, init irq info by parse savedline */ - init_irq_class_and_type(savedline, &tmp_info, irq); -+ tmp_list = g_list_append(tmp_list, &tmp_info); - /* secondly, init irq info by read device info */ -- *pinfo = build_dev_irqs(interrupts_db, irq); -+ *pinfo = build_dev_irqs(tmp_list, irq); - if (*pinfo == NULL) { - add_new_irq(NULL, &tmp_info, interrupts_db); - *pinfo = get_irq_info(irq); -@@ -779,6 +789,8 @@ int proc_irq_hotplug(char *savedline, int irq, struct irq_info **pinfo) - } - - force_rebalance_irq(*pinfo, NULL); -+ free(tmp_info.name); -+ g_list_free(tmp_list); - return 0; - } - --- -1.8.3.1 - diff --git a/feature-aarch64-add-the-regular-to-get-the-correct-i.patch b/feature-aarch64-add-the-regular-to-get-the-correct-i.patch deleted file mode 100644 index 6cbd886..0000000 --- a/feature-aarch64-add-the-regular-to-get-the-correct-i.patch +++ /dev/null @@ -1,93 +0,0 @@ -From c924f1df705a301a0ffc01fce4c7712756c8b1d2 Mon Sep 17 00:00:00 2001 -From: Zengruan Ye -Date: Sat, 13 Jul 2019 19:09:09 +0800 -Subject: [PATCH] feature: aarch64: add the regular to get the correct irq - class on hisi board - -First, get the full irq desc name, include that the name split by blank, just like -(hisi_sas_v2_hw sata). We use the irq type to mark the begin of the name. - -Second, for hisi bord, we consider to match the IRQ_SCSI class (which the -irqbalance service concerned, and the eth device match follow the -open community rule) by keywords group hisi & sas or hisi & sata. - -Signed-off-by: wanghaibin ---- - procinterrupts.c | 33 ++++++++++++++++++++++++++++++++- - 1 file changed, 32 insertions(+), 1 deletion(-) - -diff --git a/procinterrupts.c b/procinterrupts.c -index 854282f..32c5e53 100644 ---- a/procinterrupts.c -+++ b/procinterrupts.c -@@ -108,6 +108,8 @@ static void guess_arm_irq_hints(char *name, struct irq_info *info) - /* Note: Last entry is a catchall */ - static struct irq_match matches[] = { - { "eth.*" ,{NULL} ,NULL, IRQ_TYPE_LEGACY, IRQ_GBETH }, -+ { "hisi\\w*? *sas" ,{NULL} ,NULL, IRQ_TYPE_LEGACY, IRQ_SCSI}, -+ { "hisi\\w*? *sata" ,{NULL} ,NULL, IRQ_TYPE_LEGACY, IRQ_SCSI}, - { "[A-Z0-9]{4}[0-9a-f]{4}", {NULL} ,check_platform_device, IRQ_TYPE_LEGACY, IRQ_OTHER}, - { "PNP[0-9a-f]{4}", {NULL} ,check_platform_device, IRQ_TYPE_LEGACY, IRQ_OTHER}, - { ".*", {NULL}, NULL, IRQ_TYPE_LEGACY, IRQ_OTHER}, -@@ -155,6 +157,8 @@ void init_irq_class_and_type(char *savedline, struct irq_info *info, int irq) - int is_xen_dyn = 0; - #ifdef AARCH64 - char *tmp = NULL; -+ int irq_fullname_valid = 1; -+ char irq_fullname[PATH_MAX] = {0}; - #endif - - irq_name = strtok_r(savedline, " ", &savedptr); -@@ -166,6 +170,16 @@ void init_irq_class_and_type(char *savedline, struct irq_info *info, int irq) - if (strstr(irq_name, "xen-dyn") != NULL) - is_xen_dyn = 1; - last_token = p; -+ -+#ifdef AARCH64 -+ /* -+ * /proc/interrupts format defined, after of interrupt type -+ * the reset string is mark the irq desc name. -+ */ -+ if (strncmp(irq_name, "Level", strlen("Level")) == 0 || -+ strncmp(irq_name, "Edge", strlen("Edge")) == 0) -+ break; -+#endif - } - - #ifdef AARCH64 -@@ -173,6 +187,17 @@ void init_irq_class_and_type(char *savedline, struct irq_info *info, int irq) - tmp = strchr(irq_name, '\n'); - if (tmp) - *tmp = 0; -+ -+ if (strlen(irq_name) + strlen(savedptr) + 1 < PATH_MAX) { -+ strcat(irq_fullname, irq_name); -+ strcat(irq_fullname, " "); -+ strcat(irq_fullname, savedptr); -+ tmp = strchr(irq_fullname, '\n'); -+ if (tmp) -+ *tmp = 0; -+ } else { -+ irq_fullname_valid = 0; -+ } - #endif - irq_mod = last_token; - info->irq = irq; -@@ -182,7 +207,13 @@ void init_irq_class_and_type(char *savedline, struct irq_info *info, int irq) - info->class = IRQ_VIRT_EVENT; - } else { - #ifdef AARCH64 -- guess_arm_irq_hints(irq_name, info); -+ if (irq_fullname_valid) { -+ irq_name = irq_fullname; -+ guess_arm_irq_hints(irq_name, info); -+ } else { -+ info->type = IRQ_TYPE_LEGACY; -+ info->class = IRQ_OTHER; -+ } - #else - info->type = IRQ_TYPE_LEGACY; - info->class = IRQ_OTHER; --- -2.23.0 - diff --git a/feature-add-ability-to-set-hintpolicy-during-runtime.patch b/feature-add-ability-to-set-hintpolicy-during-runtime.patch deleted file mode 100644 index 318e12e..0000000 --- a/feature-add-ability-to-set-hintpolicy-during-runtime.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 7db6af3a25c9742febce616081a723e1c92889d1 Mon Sep 17 00:00:00 2001 -From: BiaoXiang Ye -Date: Wed, 1 Jul 2020 12:05:33 +0800 -Subject: [PATCH] feature: add ability to set hintpolicy during runtime - -irqbalance adds default config --hintpolicy=subset, so we need provide the ability to set -hintpolicy back to ignore during runtime. ---- - irqbalance.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/irqbalance.c b/irqbalance.c -index 859fd6a..ffbb191 100644 ---- a/irqbalance.c -+++ b/irqbalance.c -@@ -538,6 +538,15 @@ gboolean sock_handle(gint fd, GIOCondition condition, gpointer user_data __attri - cpu_ban_string = NULL; - } - need_rescan = 1; -+ } else if (!(strncmp(buff + strlen("settings "), "hintpolicy ", -+ strlen("hintpolicy ")))) { -+ if (!(strncmp(buff + strlen("settings hintpolicy "), "ignore", -+ strlen("ignore")))) { -+ hint_enabled = 0; -+ } else if (!(strncmp(buff + strlen("settings hintpolicy "), -+ "subset", strlen("subset")))) { -+ hint_enabled = 1; -+ } - } - } - if (!strncmp(buff, "setup", strlen("setup"))) { --- -2.23.0 - diff --git a/feature-add-new-irq-migrate-rule-to-avoid-high-cpu-i.patch b/feature-add-new-irq-migrate-rule-to-avoid-high-cpu-i.patch deleted file mode 100644 index 974d579..0000000 --- a/feature-add-new-irq-migrate-rule-to-avoid-high-cpu-i.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 84a2df1c9962a87f55e1c0d3bd2118fd754a4b48 Mon Sep 17 00:00:00 2001 -From: hejingxian -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, 10 insertions(+), 2 deletions(-) - -diff --git a/irqbalance.c b/irqbalance.c -index 9449e40..82ac3ea 100644 ---- a/irqbalance.c -+++ b/irqbalance.c -@@ -72,6 +72,7 @@ GMainLoop *main_loop; - char *cpu_ban_string = NULL; - char *banned_cpumask_from_ui = NULL; - unsigned long migrate_ratio = 0; -+unsigned long load_limit = 0; - - static void sleep_approx(int seconds) - { -@@ -106,6 +107,7 @@ struct option lopts[] = { - {"hintpolicy", 1, NULL, 'h'}, - {"verifyhint", 1, NULL, 'v'}, - {"notclearhint", 0, NULL, 'n'}, -+ {"loadlimit", 1, NULL, 'g'}, - {0, 0, 0, 0} - }; - -@@ -115,6 +117,7 @@ static void usage(void) - log(TO_CONSOLE, LOG_INFO, " [--powerthresh= | -p | ] [--banirq= | -i ] [--banmod= | -m ] [--policyscript= | -l