diff --git a/backport-Add-hot-pull-method-for-irqbalance.patch b/backport-Add-hot-pull-method-for-irqbalance.patch new file mode 100644 index 0000000..2db673f --- /dev/null +++ b/backport-Add-hot-pull-method-for-irqbalance.patch @@ -0,0 +1,115 @@ +From ef9bf64affbca0b030f9128d93f302296d166dac Mon Sep 17 00:00:00 2001 +From: hejingxian 00273181 +Date: Mon, 4 Jan 2021 12:34:02 +0800 +Subject: [PATCH] Add hot pull method for irqbalance + +Conflict:NA +Reference:https://github.com/Irqbalance/irqbalance/commit/ef9bf64affbca0b030f9128d93f302296d166dac +--- + classify.c | 37 +++++++++++++++++++++++++++++++++++++ + irqbalance.h | 1 + + procinterrupts.c | 4 +++- + types.h | 1 + + 4 files changed, 42 insertions(+), 1 deletion(-) + +diff --git a/classify.c b/classify.c +index 4b6ffa8..beb2919 100644 +--- a/classify.c ++++ b/classify.c +@@ -852,3 +852,39 @@ void sort_irq_list(GList **list) + { + *list = g_list_sort(*list, sort_irqs); + } ++ ++static void remove_no_existing_irq(struct irq_info *info, void *data __attribute__((unused))) ++{ ++ GList *entry = NULL; ++ ++ if (info->existing) { ++ /* clear existing flag for next detection */ ++ info->existing = 0; ++ return; ++ } ++ ++ entry = g_list_find_custom(interrupts_db, info, compare_ints); ++ if (entry) ++ interrupts_db = g_list_delete_link(interrupts_db, entry); ++ ++ entry = g_list_find_custom(rebalance_irq_list, info, compare_ints); ++ if (entry) ++ rebalance_irq_list = g_list_delete_link(rebalance_irq_list, entry); ++ ++ if(info->assigned_obj) { ++ entry = g_list_find_custom(info->assigned_obj->interrupts, info, compare_ints); ++ if (entry) { ++ info->assigned_obj->interrupts = g_list_delete_link(info->assigned_obj->interrupts, entry); ++ } ++ } ++ log(TO_CONSOLE, LOG_INFO, "IRQ %d is removed from interrupts_db.\n", info->irq); ++ free_irq(info, NULL); ++} ++ ++void clear_no_existing_irqs(void) ++{ ++ for_each_irq(NULL, remove_no_existing_irq, NULL); ++ if (banned_irqs) { ++ for_each_irq(banned_irqs, remove_no_existing_irq, NULL); ++ } ++} ++ +diff --git a/irqbalance.h b/irqbalance.h +index d8e80a9..e7f6b94 100644 +--- a/irqbalance.h ++++ b/irqbalance.h +@@ -42,6 +42,7 @@ extern void set_interrupt_count(int number, uint64_t count); + extern void set_msi_interrupt_numa(int number); + extern void init_irq_class_and_type(char *savedline, struct irq_info *info, int irq); + extern int proc_irq_hotplug(char *line, int irq, struct irq_info **pinfo); ++extern void clear_no_existing_irqs(void); + + extern GList *rebalance_irq_list; + extern void force_rebalance_irq(struct irq_info *info, void *data __attribute__((unused))); +diff --git a/procinterrupts.c b/procinterrupts.c +index 0671be0..854282f 100644 +--- a/procinterrupts.c ++++ b/procinterrupts.c +@@ -248,7 +248,6 @@ GList* collect_full_irq_list() + return tmp_list; + } + +- + void parse_proc_interrupts(void) + { + FILE *file; +@@ -310,6 +309,7 @@ void parse_proc_interrupts(void) + break; + } + } ++ info->existing = 1; + free(savedline); + + count = 0; +@@ -354,6 +354,8 @@ void parse_proc_interrupts(void) + */ + msi_found_in_sysfs = 1; + } ++ if (!need_rescan) ++ clear_no_existing_irqs(); + fclose(file); + free(line); + } +diff --git a/types.h b/types.h +index a01d649..9693cf4 100644 +--- a/types.h ++++ b/types.h +@@ -70,6 +70,7 @@ struct irq_info { + uint64_t last_irq_count; + uint64_t load; + int moved; ++ int existing; + struct topo_obj *assigned_obj; + char *name; + }; +-- +2.23.0 + diff --git a/irqbalance.spec b/irqbalance.spec index 940d2c0..a6d3a62 100644 --- a/irqbalance.spec +++ b/irqbalance.spec @@ -1,7 +1,7 @@ Summary: A dynamic adaptive IRQ balancing daemon Name: irqbalance Version: 1.7.0 -Release: 7 +Release: 8 Epoch: 3 License: GPLv2 Source0: https://github.com/Irqbalance/irqbalance/archive/irqbalance-%{version}.tar.gz @@ -26,6 +26,7 @@ Patch6001: backport-activate_mapping-activate-only-online-CPUs.patch Patch6002: backport-log-correctly-for-isolated-and-nohz_full-cpus.patch Patch6003: backport-add-irq-hotplug-feature-for-irqbalance.patch Patch6004: backport-Add-log-for-hotplug-appropriately.patch +Patch6005: backport-Add-hot-pull-method-for-irqbalance.patch %description Irqbalance is a daemon to help balance the cpu load generated by @@ -83,6 +84,12 @@ fi /sbin/chkconfig --del %{name} >/dev/null 2>&1 || : %changelog +* Thu Jan 5 2023 qinyu - 3:1.7.0-8 +- Type:bugfix +- ID:NA +- SUG:restart +- DESC: Add hot pull method for irqbalance + * Thu Jan 5 2023 qinyu - 3:1.7.0-7 - Type:bugfix - ID:NA