From f3207add3c5c34e65584f1e0dedc9a9db7bb0578 Mon Sep 17 00:00:00 2001 From: "caomeng5@huawei.com" Date: Thu, 26 Dec 2019 09:42:32 +0800 Subject: [PATCH] rename patch --- ...g-a-duplicate-entry-to-avoid-list-ch.patch | 61 ++++++++++ ...g-a-duplicate-entry-to-avoid-list-ch.patch | 108 ------------------ irqbalance.spec | 8 +- 3 files changed, 68 insertions(+), 109 deletions(-) create mode 100644 bugfix-Prevent-inserting-a-duplicate-entry-to-avoid-list-ch.patch delete mode 100644 bugfix-prevent-inserting-a-duplicate-entry-to-avoid-list-ch.patch diff --git a/bugfix-Prevent-inserting-a-duplicate-entry-to-avoid-list-ch.patch b/bugfix-Prevent-inserting-a-duplicate-entry-to-avoid-list-ch.patch new file mode 100644 index 0000000..6fafcc1 --- /dev/null +++ b/bugfix-Prevent-inserting-a-duplicate-entry-to-avoid-list-ch.patch @@ -0,0 +1,61 @@ +From 07032f71ea956ca195c9b2386d09d24b07b7133f Mon Sep 17 00:00:00 2001 +From: hejingxian +Date: Tue, 12 Nov 2019 10:59:20 +0800 +Subject: [PATCH] Prevent inserting a duplicate entry to avoid list chaos + +Introduced by bugfix-force-irq-into-rebalance-list-when-irq-removed-and-reinserted.patch +and feature-introduce-verifyhint-to-detect-hint-variation.patch, irq may want be inserted to +rebalance list more then once, and we need to prevent this. we developped a solution in +bugfix-fix-two-same-irq-insert-to-list.patch, but we are likely to call irq_in_rebalance_list. + +this patch remove the code in bugfix-fix-two-same-irq-insert-to-list.patch and add protection +in force_rebalance_irq instead. +--- + classify.c | 2 +- + irqbalance.c | 4 ++++ + irqbalance.h | 1 + + 3 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/classify.c b/classify.c +index f041054..5aed9e5 100644 +--- a/classify.c ++++ b/classify.c +@@ -263,7 +263,7 @@ static int get_irq_class(const char *devpath) + return irq_class; + } + +-static gint compare_ints(gconstpointer a, gconstpointer b) ++gint compare_ints(gconstpointer a, gconstpointer b) + { + const struct irq_info *ai = a; + const struct irq_info *bi = b; +diff --git a/irqbalance.c b/irqbalance.c +index 395669c..faa8e6a 100644 +--- a/irqbalance.c ++++ b/irqbalance.c +@@ -251,6 +251,10 @@ void force_rebalance_irq(struct irq_info *info, void *data __attribute__((unused + if (info->level == BALANCE_NONE) + return; + ++ /* Prevent inserting a duplicate entry to avoid list chaos */ ++ if (g_list_find_custom(rebalance_irq_list, info, compare_ints)) ++ return; ++ + if (info->assigned_obj == NULL) + rebalance_irq_list = g_list_append(rebalance_irq_list, info); + else +diff --git a/irqbalance.h b/irqbalance.h +index c07a4fc..1befb46 100644 +--- a/irqbalance.h ++++ b/irqbalance.h +@@ -113,6 +113,7 @@ extern void migrate_irq(GList **from, GList **to, struct irq_info *info); + extern void free_cl_opts(void); + extern void add_cl_banned_module(char *modname); + #define irq_numa_node(irq) ((irq)->numa_node) ++extern gint compare_ints(gconstpointer a, gconstpointer b); + + extern struct irq_info *build_one_dev_entry(const char *dirname, GList *tmp_list); + extern void find_irq_dev_path(int irq, char *dirname, int length); +-- +1.8.3.1 + diff --git a/bugfix-prevent-inserting-a-duplicate-entry-to-avoid-list-ch.patch b/bugfix-prevent-inserting-a-duplicate-entry-to-avoid-list-ch.patch deleted file mode 100644 index b493353..0000000 --- a/bugfix-prevent-inserting-a-duplicate-entry-to-avoid-list-ch.patch +++ /dev/null @@ -1,108 +0,0 @@ -From 3eab5a9cee8a3641988778b676caa4cf9dcb14ab Mon Sep 17 00:00:00 2001 -From: xiashuang -Date: Sun, 11 Aug 2019 23:48:50 -0400 -Subject: [PATCH] Prevent inserting a duplicate entry to avoid list chaos - -Introduced by huawei-bugfix-force-irq-into-rebalance-list-when-irq-removed-and-reinserted.patch -and huawei-feature-introduce-verifyhint-to-detect-hint-variation.patch, irq may want be inserted to -rebalance list more then once, and we need to prevent this. we developped a solution in -huawei-bugfix-fix-two-same-irq-insert-to-list.patch, but we are likely to call irq_in_rebalance_list. - -this patch remove the code in huawei-bugfix-fix-two-same-irq-insert-to-list.patch and add protection -in force_rebalance_irq instead. ---- - classify.c | 13 +------------ - irqbalance.c | 4 ++++ - irqbalance.h | 3 ++- - procinterrupts.c | 8 ++------ - 4 files changed, 9 insertions(+), 19 deletions(-) - -diff --git a/classify.c b/classify.c -index 34a2e9f..65aeae2 100644 ---- a/classify.c -+++ b/classify.c -@@ -260,7 +260,7 @@ static int get_irq_class(const char *devpath) - return irq_class; - } - --static gint compare_ints(gconstpointer a, gconstpointer b) -+gint compare_ints(gconstpointer a, gconstpointer b) - { - const struct irq_info *ai = a; - const struct irq_info *bi = b; -@@ -293,17 +293,6 @@ static void add_banned_irq(int irq, GList **list, int extra_flag) - return; - } - --int irq_in_rebalance_list(int irq) --{ -- GList *entry = NULL; -- struct irq_info find = {0}; -- -- find.irq = irq; -- entry = g_list_find_custom(rebalance_irq_list, &find, compare_ints); -- -- return entry ? 1 : 0; --} -- - #ifdef AARCH64 - void add_banned_list_irq(int irq) - { -diff --git a/irqbalance.c b/irqbalance.c -index 6e9de88..fd72d44 100644 ---- a/irqbalance.c -+++ b/irqbalance.c -@@ -314,6 +314,10 @@ void force_rebalance_irq(struct irq_info *info, void *data __attribute__((unused - if (info->level == BALANCE_NONE) - return; - -+ /* Prevent inserting a duplicate entry to avoid list chaos */ -+ if (g_list_find_custom(rebalance_irq_list, info, compare_ints)) -+ return; -+ - if (info->assigned_obj == NULL) - rebalance_irq_list = g_list_append(rebalance_irq_list, info); - else -diff --git a/irqbalance.h b/irqbalance.h -index b6bdebd..120bc9b 100644 ---- a/irqbalance.h -+++ b/irqbalance.h -@@ -114,7 +114,8 @@ extern void free_cl_opts(void); - extern void add_cl_banned_module(char *modname); - #define irq_numa_node(irq) ((irq)->numa_node) - extern void force_rebalance_irq(struct irq_info *info, void *data __attribute__((unused))); --int irq_in_rebalance_list(int irq); -+extern gint compare_ints(gconstpointer a, gconstpointer b); -+ - /* huawei */ - extern struct irq_info *build_one_dev_entry(const char *dirname, GList *tmp_list); - extern void find_irq_dev_path(int irq, char *dirname, int length); -diff --git a/procinterrupts.c b/procinterrupts.c -index 6b25fef..4bc68d7 100644 ---- a/procinterrupts.c -+++ b/procinterrupts.c -@@ -446,9 +446,7 @@ void parse_proc_interrupts(void) - */ - if (count < info->irq_count) { - log(TO_CONSOLE, LOG_INFO, "Removed and reinserted IRQ %d added into rebalance list\n", number); -- if (!irq_in_rebalance_list(info->irq)) { -- force_rebalance_irq(info, NULL); -- } -+ force_rebalance_irq(info, NULL); - } - - info->last_irq_count = info->irq_count; -@@ -702,9 +700,7 @@ void update_affinity_hint(struct irq_info *info, void *data __attribute__((unuse - cpumask_parse_user(line, len, current_affinity_hint); - if (!cpus_equal(current_affinity_hint, info->affinity_hint)) { - cpumask_copy(info->affinity_hint, current_affinity_hint); -- if (!irq_in_rebalance_list(info->irq)) { -- force_rebalance_irq(info, data); -- } -+ force_rebalance_irq(info, data); - log(TO_ALL, LOG_INFO, "IRQ(%d): affinity hint modified\n", info->irq); - } - } --- -1.8.3.1 - diff --git a/irqbalance.spec b/irqbalance.spec index 1d6aca3..8b8e8d0 100644 --- a/irqbalance.spec +++ b/irqbalance.spec @@ -1,7 +1,7 @@ Summary: A dynamic adaptive IRQ balancing daemon Name: irqbalance Version: 1.4.0 -Release: 13 +Release: 14 Epoch: 3 License: GPLv2 @@ -133,6 +133,12 @@ fi /sbin/chkconfig --del %{name} >/dev/null 2>&1 || : %changelog +* Thu Dec 26 2019 caomeng - 3:1.4.0-14 +- Type:NA +- ID:NA +- SUG:restart +- DESC:rename the patch + * Fri Dec 20 2019 caomeng - 3:1.4.0-13 - Type:NA - ID:NA