Skip to content

Commit

Permalink
x86: resize NR_IRQS for large machines
Browse files Browse the repository at this point in the history
On machines with very large numbers of cpus, tables that are dimensioned
by NR_IRQS get very large, especially the irq_desc table.  They are also
very sparsely used.  When the cpu count is > MAX_IO_APICS, use MAX_IO_APICS
to set NR_IRQS, otherwise use NR_CPUS.

Signed-off-by: Alan Mayer <ajm@sgi.com>
Reviewed-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Alan Mayer authored and Ingo Molnar committed May 12, 2008
1 parent 492c2e4 commit 6859a84
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions include/asm-x86/irq_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* <tomsoft@informatik.tu-chemnitz.de>
*/

#include <asm/apicdef.h>

#define TIMER_IRQ 0

/*
Expand All @@ -31,7 +33,11 @@

#define FIRST_SYSTEM_VECTOR 0xef /* duplicated in hw_irq.h */

#if NR_CPUS < MAX_IO_APICS
#define NR_IRQS (NR_VECTORS + (32 * NR_CPUS))
#else
#define NR_IRQS (NR_VECTORS + (32 * MAX_IO_APICS))
#endif
#define NR_IRQ_VECTORS NR_IRQS

static inline int irq_canonicalize(int irq)
Expand Down
2 changes: 1 addition & 1 deletion include/linux/kernel_stat.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef _LINUX_KERNEL_STAT_H
#define _LINUX_KERNEL_STAT_H

#include <asm/irq.h>
#include <linux/smp.h>
#include <linux/threads.h>
#include <linux/percpu.h>
#include <linux/cpumask.h>
#include <asm/irq.h>
#include <asm/cputime.h>

/*
Expand Down

0 comments on commit 6859a84

Please sign in to comment.