From ad917abf90fc32f4b327641a111071945e7196e2 Mon Sep 17 00:00:00 2001 From: dogsheng <960055655@qq.com> Date: Wed, 25 Dec 2019 22:08:07 +0800 Subject: [PATCH] Package init --- bugfix-delete-no-existing-banned-irq.patch | 43 ++ ...-fix-a-hole-that-flees-hotplug-event.patch | 2 +- ...k-of-strdup-in-collect_full_irq_list.patch | 34 + ...rqs-in-hotplug-keep-stay-on-one-numa.patch | 161 +++++ ...-hasnot-been-added-to-rebalance-list.patch | 25 + ...al-when-sleep_interval-is-changed-by.patch | 79 +++ bugfix-fix-two-same-irq-insert-to-list.patch | 81 --- ...list-when-irq-removed-and-reinserted.patch | 3 +- ...ance-fix-wrong-pid-value-in-pid-file.patch | 21 +- ...-add-new-user-irq-policy-config-rule.patch | 57 +- ...re-add-switch-to-clear-affinity-hint.patch | 123 ++++ ...rfaces-for-irqbalance-core-functions.patch | 79 +++ feature-add-the-switch-of-printing-log.patch | 114 +++ ...-verifyhint-to-detect-hint-variation.patch | 655 +++++++++--------- ...ce-Add-ability-for-socket-communicat.patch | 50 +- ...lance-arm64-Add-irq-aff-change-check.patch | 4 +- ...urce-leak-on-the-error-paths-in-main.patch | 1 + irqbalance.spec | 53 +- 18 files changed, 1081 insertions(+), 504 deletions(-) create mode 100644 bugfix-delete-no-existing-banned-irq.patch create mode 100644 bugfix-fix-memory-leak-of-strdup-in-collect_full_irq_list.patch create mode 100644 bugfix-fix-new-irqs-in-hotplug-keep-stay-on-one-numa.patch create mode 100644 bugfix-fix-new-msi-irq-hasnot-been-added-to-rebalance-list.patch create mode 100644 bugfix-fix-sleep-interval-when-sleep_interval-is-changed-by.patch delete mode 100644 bugfix-fix-two-same-irq-insert-to-list.patch create mode 100644 feature-add-switch-to-clear-affinity-hint.patch create mode 100644 feature-add-test-interfaces-for-irqbalance-core-functions.patch create mode 100644 feature-add-the-switch-of-printing-log.patch diff --git a/bugfix-delete-no-existing-banned-irq.patch b/bugfix-delete-no-existing-banned-irq.patch new file mode 100644 index 0000000..d62a78c --- /dev/null +++ b/bugfix-delete-no-existing-banned-irq.patch @@ -0,0 +1,43 @@ +From 0d6ed42e5d195f6a00d2f000ce8da11e89cb3010 Mon Sep 17 00:00:00 2001 +From: caihongda +Date: Fri, 1 Nov 2019 10:06:03 +0800 +Subject: [PATCH] irqbalance: bufix in banned irq delete + +reason: The banned irq will not be added int interrupts_db, so + we need to additionaly delete it if it is no_existing. + To test this in llt, we add a stub for function + is_banned_irq. + +Signed-off-by: caihongda + +diff --git a/classify.c b/classify.c +index 9f72ae8..585f2dc 100644 +--- a/classify.c ++++ b/classify.c +@@ -331,6 +331,13 @@ static int is_banned_irq(int irq) + return entry ? 1:0; + } + ++#ifdef TEST ++int stub_is_banned_irq(int irq) ++{ ++ return is_banned_irq(irq); ++} ++#endif ++ + gint substr_find(gconstpointer a, gconstpointer b) + { + if (strstr(b, a)) +@@ -853,6 +860,9 @@ static void remove_no_existing_irq(struct irq_info *info, void *data __attribute + 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); ++ } + } + + void free_irq_db(void) +-- +2.19.1 + diff --git a/bugfix-fix-a-hole-that-flees-hotplug-event.patch b/bugfix-fix-a-hole-that-flees-hotplug-event.patch index 9429bef..0759d43 100644 --- a/bugfix-fix-a-hole-that-flees-hotplug-event.patch +++ b/bugfix-fix-a-hole-that-flees-hotplug-event.patch @@ -1,7 +1,7 @@ From 2c040ddc5869635598e4fbf5c63217f60fdef5f1 Mon Sep 17 00:00:00 2001 From: xiashuang Date: Sun, 17 Mar 2019 18:59:09 -0400 -Subject: [PATCH 2/4] huawei bugfix fix a hole that flees hotplug event +Subject: [PATCH 2/4] bugfix fix a hole that flees hotplug event from 1.0.9, original infoformation is missing --- diff --git a/bugfix-fix-memory-leak-of-strdup-in-collect_full_irq_list.patch b/bugfix-fix-memory-leak-of-strdup-in-collect_full_irq_list.patch new file mode 100644 index 0000000..8d8a05a --- /dev/null +++ b/bugfix-fix-memory-leak-of-strdup-in-collect_full_irq_list.patch @@ -0,0 +1,34 @@ +From f3c1502c83f5ae09202a707669c924fc2bd0cca4 Mon Sep 17 00:00:00 2001 +From: liuchao173 +Date: Mon, 18 Nov 2019 13:57:11 +0000 +Subject: [PATCH] irqblance: fix memory leak of strdup + + fix memory leak of strdup in collect_full_irq_list(), when continue +in if branch, the savedline isn't freed +--- + procinterrupts.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/procinterrupts.c b/procinterrupts.c +index e36fcac..bde31f4 100644 +--- a/procinterrupts.c ++++ b/procinterrupts.c +@@ -321,6 +321,7 @@ GList* collect_full_irq_list() + if (ban_pci_assigned_irq && is_pci_assigned_irq(c)) { + log(TO_ALL, LOG_INFO, "Banned PCI-assigned irq %d.\n", number); + add_vm_banned_irq(number); ++ free(savedline); + continue; + } + +@@ -338,6 +339,7 @@ GList* collect_full_irq_list() + * For these irqs, we can add these to banned irq list. + */ + add_banned_list_irq(number); ++ free(savedline); + continue; + } + #endif +-- +2.19.1 + diff --git a/bugfix-fix-new-irqs-in-hotplug-keep-stay-on-one-numa.patch b/bugfix-fix-new-irqs-in-hotplug-keep-stay-on-one-numa.patch new file mode 100644 index 0000000..bf95445 --- /dev/null +++ b/bugfix-fix-new-irqs-in-hotplug-keep-stay-on-one-numa.patch @@ -0,0 +1,161 @@ +From feeb95206e1f178e2bbf0393483861f364bd7d5b Mon Sep 17 00:00:00 2001 +From: liuchao173 +Date: Wed, 23 Oct 2019 11:38:17 +0000 +Subject: [PATCH] irqbalance: fix new irqs in hotplug keep stay on one numa node + + when the number of cpus is huge, hotplug occurs and new irqs will stay on one numa node +--- + classify.c | 25 +++++++++++++++++++++++++ + procinterrupts.c | 24 +++++++++++++++++++++--- + rules_config.c | 4 ++++ + 3 files changed, 50 insertions(+), 3 deletions(-) + +diff --git a/classify.c b/classify.c +index 3681c48..54f27f0 100644 +--- a/classify.c ++++ b/classify.c +@@ -38,6 +38,7 @@ static GList *banned_irqs = NULL; + GList *cl_banned_irqs = NULL; + static GList *cl_banned_modules = NULL; + GList *vm_banned_irqs = NULL; ++extern int need_add_single; + + pthread_mutex_t cl_banned_list_mutex = PTHREAD_MUTEX_INITIALIZER; + pthread_mutex_t vm_banned_list_mutex = PTHREAD_MUTEX_INITIALIZER; +@@ -646,6 +647,21 @@ static int check_for_irq_ban(char *path __attribute__((unused)), int irq, GList + return 0; + } + ++int is_proc_irq_info_exist(int irq, GList *tmp_list) ++{ ++ GList *entry; ++ struct irq_info find; ++ ++ if (!tmp_list) { ++ return 1; ++ } ++ ++ find.irq = irq; ++ entry = g_list_find_custom(tmp_list, &find, compare_ints); ++ ++ return entry ? 1 : 0; ++} ++ + /* + * Figures out which interrupt(s) relate to the device we"re looking at in dirname + */ +@@ -686,6 +702,12 @@ struct irq_info *build_one_dev_entry(const char *dirname, GList *tmp_list) + add_banned_irq(irqnum, &banned_irqs, 0); + continue; + } ++ if (!is_proc_irq_info_exist(irqnum, tmp_list)) { ++ continue; ++ } ++ if (need_add_single && need_add_single != irqnum) { ++ continue; ++ } + hint.irq = irqnum; + hint.type = IRQ_TYPE_MSIX; + new = add_one_irq_to_db(devpath, &hint, &pol); +@@ -723,6 +745,9 @@ struct irq_info *build_one_dev_entry(const char *dirname, GList *tmp_list) + add_banned_irq(irqnum, &banned_irqs, 0); + goto done; + } ++ if (!is_proc_irq_info_exist(irqnum, tmp_list)) { ++ goto done; ++ } + + hint.irq = irqnum; + hint.type = IRQ_TYPE_LEGACY; +diff --git a/procinterrupts.c b/procinterrupts.c +index c32c1b2..f0dd608 100644 +--- a/procinterrupts.c ++++ b/procinterrupts.c +@@ -43,6 +43,7 @@ + static int proc_int_has_msi = 0; + static int msi_found_in_sysfs = 0; + extern int ban_pci_assigned_irq; ++int need_add_single = 0; + + #ifdef AARCH64 + struct irq_match { +@@ -361,9 +362,10 @@ void parse_proc_interrupts(void) + uint64_t count; + char *c, *c2; + struct irq_info *info; +- struct irq_info tmp_info; +- char savedline[1024]; ++ struct irq_info tmp_info = {0}; ++ char *savedline = NULL; + char dirname[PATH_MAX] = {'\0'}; ++ struct irq_info *lookup; + + if (getline(&line, &size, file)<=0) + break; +@@ -383,7 +385,9 @@ void parse_proc_interrupts(void) + if (!c) + continue; + +- strncpy(savedline, line, sizeof(savedline)-1); ++ savedline = strdup(line); ++ if (!savedline) ++ continue; + + *c = 0; + c++; +@@ -391,23 +395,36 @@ void parse_proc_interrupts(void) + + info = get_irq_info(number); + if (!info) { ++ init_irq_class_and_type(savedline, &tmp_info, number); + find_irq_dev_path(number, dirname, PATH_MAX); + if (strlen(dirname) > 0) { ++ need_add_single = number; + info = build_one_dev_entry(dirname, NULL); ++ need_add_single = 0; ++ lookup = get_irq_info(number); ++ if (lookup != NULL) { ++ lookup->existing = 1; ++ set_usr_irq_policy(tmp_info.name, lookup); ++ } + log(TO_CONSOLE, LOG_INFO, "new IRQ %d added into database, dirname %s\n", number, dirname); + } else { +- init_irq_class_and_type(savedline, &tmp_info, number); + info = add_new_irq(number, &tmp_info, NULL); + } ++ if (tmp_info.name) { ++ free(tmp_info.name); ++ tmp_info.name = NULL; ++ } + + if (info) { + force_rebalance_irq(info, NULL); + log(TO_CONSOLE, LOG_INFO, "new IRQ %d added into rebalance list\n", number); + } else { + need_rescan = 1; ++ free(savedline); + break; + } + } ++ free(savedline); + info->existing = 1; + + if (ban_pci_assigned_irq) { +diff --git a/rules_config.c b/rules_config.c +index 767e9e1..9313fc6 100644 +--- a/rules_config.c ++++ b/rules_config.c +@@ -43,6 +43,10 @@ void set_usr_irq_policy(char *name, struct irq_info *info) + { + USER_IRQ_POLICY *user_policy; + ++ if (user_policy_list == NULL) { ++ return; ++ } ++ + user_policy = get_usr_irq_policy(name); + if (user_policy != NULL) { + if (user_policy->numa_node_set) { +-- +2.19.1 + diff --git a/bugfix-fix-new-msi-irq-hasnot-been-added-to-rebalance-list.patch b/bugfix-fix-new-msi-irq-hasnot-been-added-to-rebalance-list.patch new file mode 100644 index 0000000..a2bbe3d --- /dev/null +++ b/bugfix-fix-new-msi-irq-hasnot-been-added-to-rebalance-list.patch @@ -0,0 +1,25 @@ +From d4fc2426a38728b912ec1acf3a3a990636e48b1d Mon Sep 17 00:00:00 2001 +From: liuchao173 +Date: Fri, 1 Nov 2019 02:42:19 +0000 +Subject: [PATCH] irqbalance: fix new msi irq hasnot been added to rebalance list + + fix new msi irq hasnot been added to rebalance_irq_list +--- + procinterrupts.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/procinterrupts.c b/procinterrupts.c +index 64b462a..33e72ea 100644 +--- a/procinterrupts.c ++++ b/procinterrupts.c +@@ -405,6 +405,7 @@ void parse_proc_interrupts(void) + if (lookup != NULL) { + lookup->existing = 1; + set_usr_irq_policy(tmp_info.name, lookup); ++ info = lookup; + } + log(TO_CONSOLE, LOG_INFO, "new IRQ %d added into database, dirname %s\n", number, dirname); + } else { +-- +2.19.1 + diff --git a/bugfix-fix-sleep-interval-when-sleep_interval-is-changed-by.patch b/bugfix-fix-sleep-interval-when-sleep_interval-is-changed-by.patch new file mode 100644 index 0000000..2c8452c --- /dev/null +++ b/bugfix-fix-sleep-interval-when-sleep_interval-is-changed-by.patch @@ -0,0 +1,79 @@ +From f04d6488c12e215e2302b44c77bf66fce4950aef Mon Sep 17 00:00:00 2001 +From: liuchao +Date: Thu, 5 Dec 2019 15:28:14 +0800 +Subject: [PATCH] fix sleep interval when sleep_interval is changed by + socket + +currently, in scan, irqbalance compare sleep_interval's address to decide if sleep_interval is changed, accutually this judgement is always false now. + +Signed-off-by: liuchao +--- + hint_verify.c | 10 ++++++---- + irqbalance.c | 5 +++-- + 2 files changed, 9 insertions(+), 6 deletions(-) + +diff --git a/hint_verify.c b/hint_verify.c +index b3175ae..0718078 100644 +--- a/hint_verify.c ++++ b/hint_verify.c +@@ -15,6 +15,7 @@ + extern int keep_going; + extern GMainLoop *main_loop; + extern gboolean scan(); ++extern int last_interval; + + int real_sleep_interval; + int sleep_interval_count; +diff --git a/hint_verify.c b/hint_verify.c +index b3175ae..4258557 100644 +--- a/hint_verify.c ++++ b/hint_verify.c +@@ -84,7 +84,7 @@ void update_affinity_hint(struct irq_info *info, void *data __attribute__((unuse + * 1. scan opration for irq balancing; + * 2. poll irq affinity hint changes for quickly applying them. + */ +-gboolean poll_hint_affinity_and_scan(gpointer data) ++gboolean poll_hint_affinity_and_scan(gpointer data __attribute__((unused))) + { + gboolean need_verify_flag = FALSE; + gboolean need_scan_flag = FALSE; +@@ -118,9 +118,10 @@ gboolean poll_hint_affinity_and_scan(gpointer data) + } + } + +- if (data != &real_sleep_interval) { +- data = &real_sleep_interval; +- g_timeout_add_seconds(real_sleep_interval, poll_hint_affinity_and_scan, data); ++ update_interval_and_count(); ++ if (last_interval != real_sleep_interval) { ++ last_interval = real_sleep_interval; ++ g_timeout_add_seconds(real_sleep_interval, poll_hint_affinity_and_scan, NULL); + return FALSE; + } + +diff --git a/irqbalance.c b/irqbalance.c +index 3fc00db..05eaa29 100644 +--- a/irqbalance.c ++++ b/irqbalance.c +@@ -67,6 +67,7 @@ long HZ; + int sleep_interval = SLEEP_INTERVAL; + int hint_enabled = 0; + int poll_hint_interval = SLEEP_INTERVAL / 5; ++int last_interval; + GMainLoop *main_loop; + + char *banned_cpumask_from_ui = NULL; +@@ -641,8 +642,8 @@ int main(int argc, char** argv) + log(TO_ALL, LOG_INFO, "irqbalance start scan.\n"); + update_interval_and_count(); + main_loop = g_main_loop_new(NULL, FALSE); +- int *last_interval = &real_sleep_interval; +- g_timeout_add_seconds(real_sleep_interval, poll_hint_affinity_and_scan, last_interval); ++ last_interval = real_sleep_interval; ++ g_timeout_add_seconds(real_sleep_interval, poll_hint_affinity_and_scan, NULL); + g_main_loop_run(main_loop); + + g_main_loop_quit(main_loop); +-- +2.19.1 + diff --git a/bugfix-fix-two-same-irq-insert-to-list.patch b/bugfix-fix-two-same-irq-insert-to-list.patch deleted file mode 100644 index f1aa574..0000000 --- a/bugfix-fix-two-same-irq-insert-to-list.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 384cdfa4ef28415c3df50d1759951a20c6f0661f Mon Sep 17 00:00:00 2001 -From: caomeng -Date: Thu, 4 Jul 2019 03:47:20 +0800 -Subject: [PATCH] bugfix-fix-two-same-irq-insert-to-list - -When the function force_rebalance_irq is executed,the same irq may be added into -rebalance_irq_list again, resulting in failed irqbalance service. Thus, a function -named irq_in_rebalance_list which is used to check if the irq is in rebalance_irq_list -will be executed before force_rebalance_irq. And this patch fixex the bug introduced -by feature-introduce-verifyhint-to-detect-hint-variation.patch. - ---- - classify.c | 11 +++++++++++ - irqbalance.h | 2 +- - procinterrupts.c | 8 ++++++-- - 3 files changed, 18 insertions(+), 3 deletions(-) - -diff --git a/classify.c b/classify.c -index 0951c72..4d699da 100644 ---- a/classify.c -+++ b/classify.c -@@ -288,6 +288,17 @@ static void add_banned_irq(int irq, GList **list) - 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; -+} -+ - void add_cl_banned_irq(int irq) - { - add_banned_irq(irq, &cl_banned_irqs); -diff --git a/irqbalance.h b/irqbalance.h -index 80ec017..821de0e 100644 ---- a/irqbalance.h -+++ b/irqbalance.h -@@ -107,7 +107,7 @@ 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); - /* 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 fc4641a..9e38e49 100644 ---- a/procinterrupts.c -+++ b/procinterrupts.c -@@ -348,7 +348,9 @@ 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); -- force_rebalance_irq(info, NULL); -+ if (!irq_in_rebalance_list(info->irq)) { -+ force_rebalance_irq(info, NULL); -+ } - } - - info->last_irq_count = info->irq_count; -@@ -602,7 +604,9 @@ 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); -- force_rebalance_irq(info, data); -+ if (!irq_in_rebalance_list(info->irq)) { -+ 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/bugfix-force-irq-into-rebalance-list-when-irq-removed-and-reinserted.patch b/bugfix-force-irq-into-rebalance-list-when-irq-removed-and-reinserted.patch index 40df5a0..4faa9bb 100644 --- a/bugfix-force-irq-into-rebalance-list-when-irq-removed-and-reinserted.patch +++ b/bugfix-force-irq-into-rebalance-list-when-irq-removed-and-reinserted.patch @@ -244,11 +244,10 @@ diff --git a/irqbalance.h b/irqbalance.h index 8d5b329..73737ed 100644 --- a/irqbalance.h +++ b/irqbalance.h -@@ -107,6 +107,11 @@ extern void free_cl_opts(void); +@@ -107,6 +107,10 @@ extern void free_cl_opts(void); extern void add_cl_banned_module(char *modname); #define irq_numa_node(irq) ((irq)->numa_node) -+/* 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); +extern struct irq_info *add_new_irq(int irq, struct irq_info *hint, GList *proc_interrupts); diff --git a/bugfix-irqbalance-fix-wrong-pid-value-in-pid-file.patch b/bugfix-irqbalance-fix-wrong-pid-value-in-pid-file.patch index 270e2c3..66807e2 100644 --- a/bugfix-irqbalance-fix-wrong-pid-value-in-pid-file.patch +++ b/bugfix-irqbalance-fix-wrong-pid-value-in-pid-file.patch @@ -1,7 +1,7 @@ -From d57caa98c082fb3bf746b0877aa368544e8e62dc Mon Sep 17 00:00:00 2001 -From: Zengruan Ye -Date: Mon, 15 Jul 2019 21:37:39 +0800 -Subject: [PATCH 4/6] bugfix: irqbalance: fix wrong pid value in pid file +From 948425c293615a9f4a30e9049d6ca4380c7b6c83 Mon Sep 17 00:00:00 2001 +From: hejingxian +Date: Wed, 13 Nov 2019 13:13:28 +0800 +Subject: [PATCH] bugfix: irqbalance: fix wrong pid value in pid file If irqbalance is killed by SIGKILL or SIGTERM, after restarting irqbalance, the pid in pid file is @@ -13,14 +13,14 @@ been launched. Signed-off-by: zhanghailiang --- - irqbalance.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------ - 1 file changed, 73 insertions(+), 8 deletions(-) + irqbalance.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 75 insertions(+), 8 deletions(-) diff --git a/irqbalance.c b/irqbalance.c -index 40ec65c..27cf2eb 100644 +index 18cd7de..467e968 100644 --- a/irqbalance.c +++ b/irqbalance.c -@@ -584,6 +584,77 @@ int init_socket() +@@ -560,6 +560,78 @@ int init_socket() return 0; } @@ -94,11 +94,12 @@ index 40ec65c..27cf2eb 100644 + close(lf); + return err; +} ++ + int main(int argc, char** argv) { - struct sigaction action, hupaction; -@@ -709,17 +782,12 @@ int main(int argc, char** argv) + sigset_t sigset, old_sigset; +@@ -652,17 +724,12 @@ int main(int argc, char** argv) } if (!foreground_mode) { diff --git a/feature-add-new-user-irq-policy-config-rule.patch b/feature-add-new-user-irq-policy-config-rule.patch index 46b0e62..88d5856 100644 --- a/feature-add-new-user-irq-policy-config-rule.patch +++ b/feature-add-new-user-irq-policy-config-rule.patch @@ -9,14 +9,14 @@ for every irq. --- Makefile.am | 2 +- classify.c | 32 +++++++-- - irqbalance.c | 31 +++++---- + irqbalance.c | 34 +++++---- irqbalance.h | 2 +- misc/irqbalance.service | 2 +- placement.c | 3 +- procinterrupts.c | 3 +- rules_config.c | 170 ++++++++++++++++++++++++++++++++++++++++++++++++ rules_config.h | 38 +++++++++++ - 9 files changed, 260 insertions(+), 23 deletions(-) + 9 files changed, 263 insertions(+), 23 deletions(-) create mode 100644 rules_config.c create mode 100644 rules_config.h @@ -53,7 +53,7 @@ index 65aeae2..7c97d47 100644 - get_irq_user_policy(devpath, irqnum, &pol); + if (user_policy_list == NULL) { + get_irq_user_policy(devpath, irqnum, &pol); -+ } ++ } if ((pol.ban == 1) || (check_for_irq_ban(devpath, irqnum, tmp_list))) { add_banned_irq(irqnum, &banned_irqs, 0); continue; @@ -117,35 +117,35 @@ diff --git a/irqbalance.c b/irqbalance.c index 21d578a..d41753c 100644 --- a/irqbalance.c +++ b/irqbalance.c -@@ -148,6 +148,7 @@ struct option lopts[] = { +@@ -99,6 +99,7 @@ struct option lopts[] = { + {"banmod", 1 , NULL, 'm'}, {"interval", 1 , NULL, 't'}, {"version", 0, NULL, 'V'}, - {"verifyhint", 1, NULL, 'v'}, + {"rulesconfig", 1, NULL, 'r'}, {0, 0, 0, 0} }; -@@ -155,7 +156,7 @@ static void usage(void) +@@ -106,7 +107,7 @@ static void usage(void) { - log(TO_CONSOLE, LOG_INFO, "irqbalance [--oneshot | -o] [--debug | -d] [--foreground | -f] [--journal | -j] [--hintpolicy | -h ]\n"); + log(TO_CONSOLE, LOG_INFO, "irqbalance [--oneshot | -o] [--debug | -d] [--foreground | -f] [--journal | -j] [--hintpolicy= | -h [exact|subset|ignore]]\n"); log(TO_CONSOLE, LOG_INFO, " [--powerthresh= | -p | ] [--banirq= | -i ] [--banmod= | -m ] [--policyscript= | -l