[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#491309: NR_CPUS in debian linux-images



On Tue, Jul 29, 2008 at 05:19:22PM +0200, Bastian Blank wrote:
> On Tue, Jul 29, 2008 at 07:48:11AM -0700, Mike Travis wrote:
> > You could look at the 2.6.27 version of include/asm-x86/irq_vectors.h to see
> > how NR_IRQ's is somewhat lessened (at least from a NR_CPUS=4096 perspective.)
> May this change be applicable to 2.6.26 or will it break something else?

Aka something like:

diff --git a/include/asm-x86/irq_64.h b/include/asm-x86/irq_64.h
index 083d35a..30e1a6b 100644
--- a/include/asm-x86/irq_64.h
+++ b/include/asm-x86/irq_64.h
@@ -31,8 +31,22 @@
 
 #define FIRST_SYSTEM_VECTOR    0xef   /* duplicated in hw_irq.h */
 
-#define NR_IRQS (NR_VECTORS + (32 * NR_CPUS))
-#define NR_IRQ_VECTORS NR_IRQS
+#if defined(CONFIG_X86_IO_APIC) || defined(CONFIG_PARAVIRT) || defined(CONFIG_X86_VISWS)
+
+# define NR_IRQS               224
+
+# if (224 >= 32 * NR_CPUS)
+#  define NR_IRQ_VECTORS       NR_IRQS
+# else
+#  define NR_IRQ_VECTORS       (32 * NR_CPUS)
+# endif
+
+#else /* IO_APIC || PARAVIRT */
+
+# define NR_IRQS               16
+# define NR_IRQ_VECTORS        NR_IRQS
+
+#endif
 
 static inline int irq_canonicalize(int irq)
 {

Which produces (with 255 cpus):
   text    data     bss     dec     hex filename
   3532199  505256  610456 4647911  46ebe7 vmlinux

Bastian

-- 
It would be illogical to kill without reason.
		-- Spock, "Journey to Babel", stardate 3842.4



Reply to: