x86: resize NR_IRQS for large machines
authorAlan Mayer <ajm@sgi.com>
Wed, 26 Mar 2008 21:11:31 +0000 (16:11 -0500)
committerIngo Molnar <mingo@elte.hu>
Mon, 12 May 2008 19:28:05 +0000 (21:28 +0200)
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>
include/asm-x86/irq_64.h
include/linux/kernel_stat.h

index 083d35a62c94ca5d19febdac731397429bb6ee00..7608176590b659803b4c78d729baa8a2a1d4030c 100644 (file)
@@ -10,6 +10,8 @@
  *     <tomsoft@informatik.tu-chemnitz.de>
  */
 
+#include <asm/apicdef.h>
+
 #define TIMER_IRQ 0
 
 /*
 
 #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)
index e8ffce898bf913c7c12943b0a40785354dde6834..cf9f40a91c9c79837753956b135e49c9ec984630 100644 (file)
@@ -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>
 
 /*