Patchwork Regression: Bisected, IRQ and MSI allocations screwed without sparse irq

login
register
mail settings
Submitter Thomas Gleixner
Date Nov. 21, 2008, 12:34 a.m.
Message ID <alpine.LFD.2.00.0811201539360.3197@localhost.localdomain>
Download mbox | patch
Permalink /patch/9912/
State RFC
Delegated to: David Miller
Headers show

Comments

Thomas Gleixner - Nov. 21, 2008, 12:34 a.m.
Jesper,

On Thu, 20 Nov 2008, Jesper Dangaard Brouer wrote:
> I have bisected a regression to your commit
> 3235e936c0cc3589309280b6f59e5096779adae3,
> "x86: remove sparse irq from Kconfig".
> 
> Its actually not necessary your fault, as your commit simply removes
> the config option HAVE_SPARSE_IRQ.  This revels the bug / regression
> I'm exposted to.

Yup, the bisect result is pretty useless.
 
> The cause of this problem (tracked down together with Robert Olsson)
> is that on 2.6.28 I have a lot less IRQs available.  It seems max 34
> IRQs.  Due the reduced number of IRQs the NIU driver cannot get
> enough IRQs to the interfaces, and starts to use "IO-APIC" based
> IRQs.

Can you please try the attached patch ?

Thanks,

	tglx

-----
 arch/x86/kernel/io_apic.c |   22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jesper Dangaard Brouer - Nov. 21, 2008, 10:33 a.m.
On Thu, 2008-11-20 at 16:34 -0800, Thomas Gleixner wrote:
> On Thu, 20 Nov 2008, Jesper Dangaard Brouer wrote:
> > I have bisected a regression to your commit
> > 3235e936c0cc3589309280b6f59e5096779adae3,
> > "x86: remove sparse irq from Kconfig".
> > 
> > Its actually not necessary your fault, as your commit simply removes
> > the config option HAVE_SPARSE_IRQ.  This revels the bug / regression
> > I'm exposted to.
> 
> Yup, the bisect result is pretty useless.
>  
> > The cause of this problem (tracked down together with Robert Olsson)
> > is that on 2.6.28 I have a lot less IRQs available.  It seems max 34
> > IRQs.  Due the reduced number of IRQs the NIU driver cannot get
> > enough IRQs to the interfaces, and starts to use "IO-APIC" based
> > IRQs.
> 
> Can you please try the attached patch ?

I have tried the patch and it solved the problem! :-)

I'll gladly test other patches from your.  Guess this patch needs to be
brushed up before a mainline patch is ready.

My hardware is a HP ProLiant DL380-G5.


> -----
>  arch/x86/kernel/io_apic.c |   22 +---------------------
>  1 file changed, 1 insertion(+), 21 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
> @@ -3594,27 +3594,7 @@ int __init io_apic_get_redir_entries (in
>  
>  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) + 1;
> -
> -	/* double it for hotplug and msi and nmi */
> -	nr <<= 1;
> -
> -	/* something wrong ? */
> -	if (nr < nr_min)
> -		nr = nr_min;
> -	if (WARN_ON(nr > NR_IRQS))
> -		nr = NR_IRQS;
> -
> -	return nr;
> +	return NR_IRQS;
>  }
>
Thomas Gleixner - Nov. 21, 2008, 4:40 p.m.
On Fri, 21 Nov 2008, Jesper Dangaard Brouer wrote:
> > Can you please try the attached patch ?
> 
> I have tried the patch and it solved the problem! :-)
> 
> I'll gladly test other patches from your.  Guess this patch needs to be
> brushed up before a mainline patch is ready.

Ok, I queue it for mainline. This solves just the number of irqs
limitation, the rmmod problem still persists, right ?

Thanks,

	tglx


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

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
@@ -3594,27 +3594,7 @@  int __init io_apic_get_redir_entries (in
 
 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) + 1;
-
-	/* double it for hotplug and msi and nmi */
-	nr <<= 1;
-
-	/* something wrong ? */
-	if (nr < nr_min)
-		nr = nr_min;
-	if (WARN_ON(nr > NR_IRQS))
-		nr = NR_IRQS;
-
-	return nr;
+	return NR_IRQS;
 }
 
 /* --------------------------------------------------------------------------