diff options
author | Yinghai Lu <yinghai@kernel.org> | 2009-02-08 19:18:03 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-09 03:21:27 -0500 |
commit | f1ee5548a6507d2b4293635c61ddbf12e2c00e94 (patch) | |
tree | 34af86add791e385c11c8172c870732307feaac8 /arch/x86/kernel | |
parent | 8f9ca475c994e4d32f405183d07e8c7eedbdbdb4 (diff) |
x86/irq: optimize nr_irqs
Impact: make nr_irqs depend more on cards used in a system
depend on nr_irq_gsi more, and have a ratio for MSI.
v2: make nr_irqs less than NR_VECTORS * nr_cpu_ids
aka if only one cpu, we only can support nr_irqs = NR_VECTORS
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/io_apic.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c index 9578d33f20a0..43f95d7b13af 100644 --- a/arch/x86/kernel/io_apic.c +++ b/arch/x86/kernel/io_apic.c | |||
@@ -3479,9 +3479,9 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | |||
3479 | sub_handle = 0; | 3479 | sub_handle = 0; |
3480 | list_for_each_entry(msidesc, &dev->msi_list, list) { | 3480 | list_for_each_entry(msidesc, &dev->msi_list, list) { |
3481 | irq = create_irq_nr(irq_want); | 3481 | irq = create_irq_nr(irq_want); |
3482 | irq_want++; | ||
3483 | if (irq == 0) | 3482 | if (irq == 0) |
3484 | return -1; | 3483 | return -1; |
3484 | irq_want = irq + 1; | ||
3485 | #ifdef CONFIG_INTR_REMAP | 3485 | #ifdef CONFIG_INTR_REMAP |
3486 | if (!intr_remapping_enabled) | 3486 | if (!intr_remapping_enabled) |
3487 | goto no_ir; | 3487 | goto no_ir; |
@@ -3825,11 +3825,17 @@ int __init arch_probe_nr_irqs(void) | |||
3825 | { | 3825 | { |
3826 | int nr; | 3826 | int nr; |
3827 | 3827 | ||
3828 | nr = ((8 * nr_cpu_ids) > (32 * nr_ioapics) ? | 3828 | if (nr_irqs > (NR_VECTORS * nr_cpu_ids)) |
3829 | (NR_VECTORS + (8 * nr_cpu_ids)) : | 3829 | nr_irqs = NR_VECTORS * nr_cpu_ids; |
3830 | (NR_VECTORS + (32 * nr_ioapics))); | ||
3831 | 3830 | ||
3832 | if (nr < nr_irqs && nr > nr_irqs_gsi) | 3831 | nr = nr_irqs_gsi + 8 * nr_cpu_ids; |
3832 | #if defined(CONFIG_PCI_MSI) || defined(CONFIG_HT_IRQ) | ||
3833 | /* | ||
3834 | * for MSI and HT dyn irq | ||
3835 | */ | ||
3836 | nr += nr_irqs_gsi * 16; | ||
3837 | #endif | ||
3838 | if (nr < nr_irqs) | ||
3833 | nr_irqs = nr; | 3839 | nr_irqs = nr; |
3834 | 3840 | ||
3835 | return 0; | 3841 | return 0; |