public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: fix probe_nr_irqs for xen
@ 2008-08-21 20:10 Yinghai Lu
  2008-08-21 23:33 ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 13+ messages in thread
From: Yinghai Lu @ 2008-08-21 20:10 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Andrew Morton
  Cc: linux-kernel, Yinghai Lu, Alex Nixon

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;
 }

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-08-22 13:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-21 20:10 [PATCH] x86: fix probe_nr_irqs for xen Yinghai Lu
2008-08-21 23:33 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox