Skip to content

Commit

Permalink
Fix bad mask computation when BANNED_INTERRUPTS is used (Gogle code I…
Browse files Browse the repository at this point in the history
…ssue #1)

git-svn-id: https://irqbalance.googlecode.com/svn/trunk@20 46b42954-3823-0410-bd82-eb80b452c9b5
  • Loading branch information
nhorman committed Jan 28, 2009
1 parent a0af684 commit 175844b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion irqbalance.h
Expand Up @@ -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);
Expand Down
9 changes: 3 additions & 6 deletions irqlist.c
Expand Up @@ -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);
}

Expand All @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down
6 changes: 1 addition & 5 deletions procinterrupts.c
Expand Up @@ -47,7 +47,6 @@ void parse_proc_interrupts(void)
}

while (!feof(file)) {
cpumask_t present;
int cpunr;
int number;
uint64_t count;
Expand All @@ -66,7 +65,6 @@ void parse_proc_interrupts(void)
*c = 0;
c++;
number = strtoul(line, NULL, 10);
cpus_clear(present);
count = 0;
cpunr = 0;

Expand All @@ -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);
Expand Down

0 comments on commit 175844b

Please sign in to comment.