From 175844b91b1524ce1f4a2d2d918c2260d4c6a179 Mon Sep 17 00:00:00 2001 From: nhorman Date: Wed, 28 Jan 2009 18:18:04 +0000 Subject: [PATCH] Fix bad mask computation when BANNED_INTERRUPTS is used (Gogle code Issue #1) git-svn-id: https://irqbalance.googlecode.com/svn/trunk@20 46b42954-3823-0410-bd82-eb80b452c9b5 --- irqbalance.h | 2 +- irqlist.c | 9 +++------ procinterrupts.c | 6 +----- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/irqbalance.h b/irqbalance.h index e9c1ad4..eafe13e 100644 --- a/irqbalance.h +++ b/irqbalance.h @@ -29,7 +29,7 @@ extern GList *interrupts; extern void parse_cpu_tree(void); extern void clear_work_stats(void); extern void parse_proc_interrupts(void); -extern void set_interrupt_count(int number, uint64_t count, cpumask_t *mask); +extern void set_interrupt_count(int number, uint64_t count); extern void add_interrupt_count(int number, uint64_t count, int type); extern int find_class(struct interrupt *irq, char *string); extern void add_interrupt_numa(int number, cpumask_t mask, int type); diff --git a/irqlist.c b/irqlist.c index 4594552..7b31d60 100644 --- a/irqlist.c +++ b/irqlist.c @@ -102,15 +102,15 @@ static void investigate(struct interrupt *irq, int number) /* next, check the IRQBALANCE_BANNED_INTERRUPTS env variable for blacklisted irqs */ - c = getenv("IRQBALANCE_BANNED_INTERRUPTS"); + c = c2 = getenv("IRQBALANCE_BANNED_INTERRUPTS"); if (!c) return; do { + c = c2; nr = strtoul(c, &c2, 10); if (c!=c2 && nr == number) irq->balance_level = BALANCE_NONE; - c = c2; } while (c!=c2 && c2!=NULL); } @@ -119,7 +119,7 @@ static void investigate(struct interrupt *irq, int number) * Set the number of interrupts received for a specific irq; * create the irq metadata if there is none yet */ -void set_interrupt_count(int number, uint64_t count, cpumask_t *mask) +void set_interrupt_count(int number, uint64_t count) { GList *item; struct interrupt *irq; @@ -147,9 +147,6 @@ void set_interrupt_count(int number, uint64_t count, cpumask_t *mask) irq->count = count; irq->allowed_mask = CPU_MASK_ALL; investigate(irq, number); - if (irq->balance_level == BALANCE_NONE) - irq->mask = *mask; - interrupts = g_list_append(interrupts, irq); } diff --git a/procinterrupts.c b/procinterrupts.c index 7461c84..d91b836 100644 --- a/procinterrupts.c +++ b/procinterrupts.c @@ -47,7 +47,6 @@ void parse_proc_interrupts(void) } while (!feof(file)) { - cpumask_t present; int cpunr; int number; uint64_t count; @@ -66,7 +65,6 @@ void parse_proc_interrupts(void) *c = 0; c++; number = strtoul(line, NULL, 10); - cpus_clear(present); count = 0; cpunr = 0; @@ -78,14 +76,12 @@ void parse_proc_interrupts(void) break; count += C; c=c2; - if (C) - cpu_set(cpunr, present); cpunr++; } if (cpunr != core_count) need_cpu_rescan = 1; - set_interrupt_count(number, count, &present); + set_interrupt_count(number, count); } fclose(file); free(line);