From: Yinghai Lu <yinghai@kernel.org>
To: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] x86/irq: optimizing nr_irqs
Date: Fri, 06 Feb 2009 16:00:40 -0800 [thread overview]
Message-ID: <498CCF28.3050207@kernel.org> (raw)
In-Reply-To: <498CCEDB.8050708@kernel.org>
Impact: more depend on cards to be used
depend on nr_irq_gsi more, and have a ratio for MSI
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
arch/x86/kernel/io_apic.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
Index: linux-2.6/arch/x86/kernel/io_apic.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/io_apic.c
+++ linux-2.6/arch/x86/kernel/io_apic.c
@@ -3479,9 +3479,9 @@ int arch_setup_msi_irqs(struct pci_dev *
sub_handle = 0;
list_for_each_entry(msidesc, &dev->msi_list, list) {
irq = create_irq_nr(irq_want);
- irq_want++;
if (irq == 0)
return -1;
+ irq_want = irq + 1;
#ifdef CONFIG_INTR_REMAP
if (!intr_remapping_enabled)
goto no_ir;
@@ -3835,11 +3835,14 @@ int __init arch_probe_nr_irqs(void)
{
int nr;
- nr = ((8 * nr_cpu_ids) > (32 * nr_ioapics) ?
- (NR_VECTORS + (8 * nr_cpu_ids)) :
- (NR_VECTORS + (32 * nr_ioapics)));
-
- if (nr < nr_irqs && nr > nr_irqs_gsi)
+ nr = nr_irqs_gsi + 8 * nr_cpu_ids;
+#if defined(CONFIG_PCI_MSI) || defined(CONFIG_HT_IRQ)
+ /*
+ * for MSI and HT dyn irq
+ */
+ nr += nr_irqs_gsi * 16;
+#endif
+ if (nr < (NR_VECTORS * nr_cpu_ids))
nr_irqs = nr;
return 0;
next prev parent reply other threads:[~2009-02-07 0:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-06 23:59 [PATCH] x86: find nr_irqs_gsi with mp_ioapic_routing Yinghai Lu
2009-02-07 0:00 ` Yinghai Lu [this message]
2009-02-08 9:44 ` [PATCH] x86/irq: optimizing nr_irqs -v2 Yinghai Lu
2009-02-09 8:14 ` Ingo Molnar
2009-02-07 3:35 ` [PATCH] x86: find nr_irqs_gsi with mp_ioapic_routing Len Brown
2009-02-07 3:47 ` Yinghai Lu
2009-02-07 7:15 ` Len Brown
2009-02-08 1:13 ` [PATCH] x86: use NR_IRQS_LEGACY to replace 16 Yinghai Lu
2009-02-09 8:14 ` Ingo Molnar
2009-02-09 8:13 ` [PATCH] x86: find nr_irqs_gsi with mp_ioapic_routing Ingo Molnar
2009-02-09 9:03 ` [PATCH] x86: find nr_irqs_gsi with mp_ioapic_routing v3 Yinghai Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=498CCF28.3050207@kernel.org \
--to=yinghai@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox