aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2009-12-29 00:08:29 -0500
committerIngo Molnar <mingo@elte.hu>2009-12-30 05:55:59 -0500
commit9959c888a38b0f25b0e81a480f537d6489348442 (patch)
tree3da4a8fbcc6da66f5c830509e02bbca83c3d77bf /arch
parent6b7b284958d47b77d06745b36bc7f36dab769d9b (diff)
x86: Increase NR_IRQS and nr_irqs
I have a system with lots of igb and ixgbe, when iov/vf are enabled for them, we hit the limit of 3064. when system has 20 pcie installed, and one card has 2 functions, and one function needs 64 msi-x, may need 20 * 2 * 64 = 2560 for msi-x but if iov and vf are enabled may need 20 * 2 * 64 * 3 = 7680 for msi-x assume system with 5 ioapic, nr_irqs_gsi will be 120. NR_CPUS = 512, and nr_cpu_ids = 128 will have NR_IRQS = 256 + 512 * 64 = 33024 will have nr_irqs = 120 + 8 * 128 + 120 * 64 = 8824 When SPARSE_IRQ is not set, there is no increase with kernel data size. when NR_CPUS=128, and SPARSE_IRQ is set: text data bss dec hex filename 21837444 4216564 12480736 38534744 24bfe58 vmlinux.before 21837442 4216580 12480736 38534758 24bfe66 vmlinux.after when NR_CPUS=4096, and SPARSE_IRQ is set text data bss dec hex filename 21878619 5610244 13415392 40904255 270263f vmlinux.before 21878617 5610244 13415392 40904253 270263d vmlinux.after Signed-off-by: Yinghai Lu <yinghai@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> LKML-Reference: <4B398ECD.1080506@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/irq_vectors.h12
-rw-r--r--arch/x86/kernel/apic/io_apic.c2
2 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h
index 4611f085cd43..3ab43df089cd 100644
--- a/arch/x86/include/asm/irq_vectors.h
+++ b/arch/x86/include/asm/irq_vectors.h
@@ -154,21 +154,21 @@ static inline int invalid_vm86_irq(int irq)
154 154
155#define NR_IRQS_LEGACY 16 155#define NR_IRQS_LEGACY 16
156 156
157#define CPU_VECTOR_LIMIT ( 8 * NR_CPUS )
158#define IO_APIC_VECTOR_LIMIT ( 32 * MAX_IO_APICS ) 157#define IO_APIC_VECTOR_LIMIT ( 32 * MAX_IO_APICS )
159 158
160#ifdef CONFIG_X86_IO_APIC 159#ifdef CONFIG_X86_IO_APIC
161# ifdef CONFIG_SPARSE_IRQ 160# ifdef CONFIG_SPARSE_IRQ
161# define CPU_VECTOR_LIMIT (64 * NR_CPUS)
162# define NR_IRQS \ 162# define NR_IRQS \
163 (CPU_VECTOR_LIMIT > IO_APIC_VECTOR_LIMIT ? \ 163 (CPU_VECTOR_LIMIT > IO_APIC_VECTOR_LIMIT ? \
164 (NR_VECTORS + CPU_VECTOR_LIMIT) : \ 164 (NR_VECTORS + CPU_VECTOR_LIMIT) : \
165 (NR_VECTORS + IO_APIC_VECTOR_LIMIT)) 165 (NR_VECTORS + IO_APIC_VECTOR_LIMIT))
166# else 166# else
167# if NR_CPUS < MAX_IO_APICS 167# define CPU_VECTOR_LIMIT (32 * NR_CPUS)
168# define NR_IRQS (NR_VECTORS + 4*CPU_VECTOR_LIMIT) 168# define NR_IRQS \
169# else 169 (CPU_VECTOR_LIMIT < IO_APIC_VECTOR_LIMIT ? \
170# define NR_IRQS (NR_VECTORS + IO_APIC_VECTOR_LIMIT) 170 (NR_VECTORS + CPU_VECTOR_LIMIT) : \
171# endif 171 (NR_VECTORS + IO_APIC_VECTOR_LIMIT))
172# endif 172# endif
173#else /* !CONFIG_X86_IO_APIC: */ 173#else /* !CONFIG_X86_IO_APIC: */
174# define NR_IRQS NR_IRQS_LEGACY 174# define NR_IRQS NR_IRQS_LEGACY
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index de00c4619a55..d9cd1f1b9c07 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3840,7 +3840,7 @@ int __init arch_probe_nr_irqs(void)
3840 /* 3840 /*
3841 * for MSI and HT dyn irq 3841 * for MSI and HT dyn irq
3842 */ 3842 */
3843 nr += nr_irqs_gsi * 16; 3843 nr += nr_irqs_gsi * 64;
3844#endif 3844#endif
3845 if (nr < nr_irqs) 3845 if (nr < nr_irqs)
3846 nr_irqs = nr; 3846 nr_irqs = nr;