Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135778
b: refs/heads/master
c: 005bf0e
h: refs/heads/master
v: v3
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Feb 9, 2009
1 parent f183f1f commit 6776f9a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0f3c2a89c1451cdf6328f99977bd9decd4f708e1
refs/heads/master: 005bf0e6fa0e9543933fe2e36322af649df7cacb
20 changes: 11 additions & 9 deletions trunk/kernel/irq/handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,21 @@ static struct irq_desc irq_desc_init = {

void init_kstat_irqs(struct irq_desc *desc, int cpu, int nr)
{
unsigned long bytes;
char *ptr;
int node;

/* Compute how many bytes we need per irq and allocate them */
bytes = nr * sizeof(unsigned int);
void *ptr;

node = cpu_to_node(cpu);
ptr = kzalloc_node(bytes, GFP_ATOMIC, node);
printk(KERN_DEBUG " alloc kstat_irqs on cpu %d node %d\n", cpu, node);
ptr = kzalloc_node(nr * sizeof(*desc->kstat_irqs), GFP_ATOMIC, node);

if (ptr)
desc->kstat_irqs = (unsigned int *)ptr;
/*
* don't overwite if can not get new one
* init_copy_kstat_irqs() could still use old one
*/
if (ptr) {
printk(KERN_DEBUG " alloc kstat_irqs on cpu %d node %d\n",
cpu, node);
desc->kstat_irqs = ptr;
}
}

static void init_one_irq_desc(int irq, struct irq_desc *desc, int cpu)
Expand Down
11 changes: 3 additions & 8 deletions trunk/kernel/irq/numa_migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@ static void init_copy_kstat_irqs(struct irq_desc *old_desc,
struct irq_desc *desc,
int cpu, int nr)
{
unsigned long bytes;

init_kstat_irqs(desc, cpu, nr);

if (desc->kstat_irqs != old_desc->kstat_irqs) {
/* Compute how many bytes we need per irq and allocate them */
bytes = nr * sizeof(unsigned int);

memcpy(desc->kstat_irqs, old_desc->kstat_irqs, bytes);
}
if (desc->kstat_irqs != old_desc->kstat_irqs)
memcpy(desc->kstat_irqs, old_desc->kstat_irqs,
nr * sizeof(*desc->kstat_irqs));
}

static void free_kstat_irqs(struct irq_desc *old_desc, struct irq_desc *desc)
Expand Down

0 comments on commit 6776f9a

Please sign in to comment.