Commit 7d0effa8 authored by Ivan Kokshaysky's avatar Ivan Kokshaysky Committed by Richard Henderson

[PATCH] alpha irq proc update

From Jeff.Wiedemeier@hp.com:

- Only create smp_affinity /proc nodes if a set_affinity handler
  is provided.
- Limit the number of irq nodes that will be created in /proc
  to avoid overfilling the /proc inode space.
parent 7d3c579c
...@@ -362,15 +362,17 @@ register_irq_proc (unsigned int irq) ...@@ -362,15 +362,17 @@ register_irq_proc (unsigned int irq)
irq_dir[irq] = proc_mkdir(name, root_irq_dir); irq_dir[irq] = proc_mkdir(name, root_irq_dir);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* create /proc/irq/1234/smp_affinity */ if (irq_desc[irq].handler->set_affinity) {
entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]); /* create /proc/irq/1234/smp_affinity */
entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]);
entry->nlink = 1; entry->nlink = 1;
entry->data = (void *)(long)irq; entry->data = (void *)(long)irq;
entry->read_proc = irq_affinity_read_proc; entry->read_proc = irq_affinity_read_proc;
entry->write_proc = irq_affinity_write_proc; entry->write_proc = irq_affinity_write_proc;
smp_affinity_entry[irq] = entry; smp_affinity_entry[irq] = entry;
}
#endif #endif
} }
...@@ -398,12 +400,16 @@ init_irq_proc (void) ...@@ -398,12 +400,16 @@ init_irq_proc (void)
#endif #endif
/* /*
* Create entries for all existing IRQs. * Create entries for all existing IRQs. If the number of IRQs
* is greater the 1/4 the total dynamic inode space for /proc,
* don't pollute the inode space
*/ */
for (i = 0; i < NR_IRQS; i++) { if (ACTUAL_NR_IRQS < (PROC_NDYNAMIC / 4)) {
if (irq_desc[i].handler == &no_irq_type) for (i = 0; i < ACTUAL_NR_IRQS; i++) {
continue; if (irq_desc[i].handler == &no_irq_type)
register_irq_proc(i); continue;
register_irq_proc(i);
}
} }
} }
...@@ -518,7 +524,7 @@ show_interrupts(struct seq_file *p, void *v) ...@@ -518,7 +524,7 @@ show_interrupts(struct seq_file *p, void *v)
seq_putc(p, '\n'); seq_putc(p, '\n');
#endif #endif
for (i = 0; i < NR_IRQS; i++) { for (i = 0; i < ACTUAL_NR_IRQS; i++) {
action = irq_desc[i].action; action = irq_desc[i].action;
if (!action) if (!action)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment