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
This commit is contained in:
nhorman 2009-01-28 18:18:04 +00:00
parent a0af6841cd
commit 175844b91b
3 changed files with 5 additions and 12 deletions

View file

@ -29,7 +29,7 @@ extern GList *interrupts;
extern void parse_cpu_tree(void); extern void parse_cpu_tree(void);
extern void clear_work_stats(void); extern void clear_work_stats(void);
extern void parse_proc_interrupts(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 void add_interrupt_count(int number, uint64_t count, int type);
extern int find_class(struct interrupt *irq, char *string); extern int find_class(struct interrupt *irq, char *string);
extern void add_interrupt_numa(int number, cpumask_t mask, int type); extern void add_interrupt_numa(int number, cpumask_t mask, int type);

View file

@ -102,15 +102,15 @@ static void investigate(struct interrupt *irq, int number)
/* next, check the IRQBALANCE_BANNED_INTERRUPTS env variable for blacklisted irqs */ /* next, check the IRQBALANCE_BANNED_INTERRUPTS env variable for blacklisted irqs */
c = getenv("IRQBALANCE_BANNED_INTERRUPTS"); c = c2 = getenv("IRQBALANCE_BANNED_INTERRUPTS");
if (!c) if (!c)
return; return;
do { do {
c = c2;
nr = strtoul(c, &c2, 10); nr = strtoul(c, &c2, 10);
if (c!=c2 && nr == number) if (c!=c2 && nr == number)
irq->balance_level = BALANCE_NONE; irq->balance_level = BALANCE_NONE;
c = c2;
} while (c!=c2 && c2!=NULL); } 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; * Set the number of interrupts received for a specific irq;
* create the irq metadata if there is none yet * 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; GList *item;
struct interrupt *irq; struct interrupt *irq;
@ -147,9 +147,6 @@ void set_interrupt_count(int number, uint64_t count, cpumask_t *mask)
irq->count = count; irq->count = count;
irq->allowed_mask = CPU_MASK_ALL; irq->allowed_mask = CPU_MASK_ALL;
investigate(irq, number); investigate(irq, number);
if (irq->balance_level == BALANCE_NONE)
irq->mask = *mask;
interrupts = g_list_append(interrupts, irq); interrupts = g_list_append(interrupts, irq);
} }

View file

@ -47,7 +47,6 @@ void parse_proc_interrupts(void)
} }
while (!feof(file)) { while (!feof(file)) {
cpumask_t present;
int cpunr; int cpunr;
int number; int number;
uint64_t count; uint64_t count;
@ -66,7 +65,6 @@ void parse_proc_interrupts(void)
*c = 0; *c = 0;
c++; c++;
number = strtoul(line, NULL, 10); number = strtoul(line, NULL, 10);
cpus_clear(present);
count = 0; count = 0;
cpunr = 0; cpunr = 0;
@ -78,14 +76,12 @@ void parse_proc_interrupts(void)
break; break;
count += C; count += C;
c=c2; c=c2;
if (C)
cpu_set(cpunr, present);
cpunr++; cpunr++;
} }
if (cpunr != core_count) if (cpunr != core_count)
need_cpu_rescan = 1; need_cpu_rescan = 1;
set_interrupt_count(number, count, &present); set_interrupt_count(number, count);
} }
fclose(file); fclose(file);
free(line); free(line);