public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yinghai Lu <yhlu.kernel@gmail.com>
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, Yinghai Lu <yhlu.kernel@gmail.com>,
	Alex Nixon <alex.nixon@citrix.com>
Subject: [PATCH] x86: fix probe_nr_irqs for xen
Date: Thu, 21 Aug 2008 13:10:09 -0700	[thread overview]
Message-ID: <1219349409-15698-1-git-send-email-yhlu.kernel@gmail.com> (raw)

otherwise Xen is _completely_ unusable with 5 or more VCPUs.
( when !CONFIG_HAVE_SPARSE_IRQ)

based on Alex's patch

also add +1 offset after redir_entries

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Alex Nixon <alex.nixon@citrix.com>

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
@@ -3625,16 +3625,21 @@ int __init probe_nr_irqs(void)
 {
 	int idx;
 	int nr = 0;
+#ifndef CONFIG_XEN
+	int nr_min = 32;
+#else
+	int nr_min = NR_IRQS;
+#endif
 
 	for (idx = 0; idx < nr_ioapics; idx++)
-		nr += io_apic_get_redir_entries(idx);
+		nr += io_apic_get_redir_entries(idx) + 1;
 
 	/* double it for hotplug and msi and nmi */
 	nr <<= 1;
 
 	/* something wrong ? */
-	if (nr < 32)
-		nr = 32;
+	if (nr < nr_min)
+		nr = nr_min;
 
 	return nr;
 }

             reply	other threads:[~2008-08-21 20:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-21 20:10 Yinghai Lu [this message]
2008-08-21 23:33 ` [PATCH] x86: fix probe_nr_irqs for xen Jeremy Fitzhardinge
2008-08-21 23:49   ` Yinghai Lu
2008-08-21 23:52     ` Jeremy Fitzhardinge
2008-08-21 23:56       ` Yinghai Lu
2008-08-22  0:02         ` Jeremy Fitzhardinge
2008-08-22  0:27           ` Yinghai Lu
2008-08-22  4:26           ` Ingo Molnar
2008-08-22  5:06             ` Yinghai Lu
2008-08-22  5:16               ` Ingo Molnar
2008-08-22 13:44                 ` Cyrill Gorcunov
2008-08-22  4:28   ` Ingo Molnar
2008-08-22  9:07     ` Alex Nixon

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=1219349409-15698-1-git-send-email-yhlu.kernel@gmail.com \
    --to=yhlu.kernel@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex.nixon@citrix.com \
    --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