From patchwork Fri Nov 21 19:35:32 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Dangaard Brouer X-Patchwork-Id: 10107 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 869B3474C2 for ; Sat, 22 Nov 2008 06:35:46 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755454AbYKUTfj (ORCPT ); Fri, 21 Nov 2008 14:35:39 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752955AbYKUTfi (ORCPT ); Fri, 21 Nov 2008 14:35:38 -0500 Received: from mgw1.diku.dk ([130.225.96.91]:41111 "EHLO mgw1.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752115AbYKUTfg (ORCPT ); Fri, 21 Nov 2008 14:35:36 -0500 Received: from localhost (localhost [127.0.0.1]) by mgw1.diku.dk (Postfix) with ESMTP id 955BB52C311; Fri, 21 Nov 2008 20:35:34 +0100 (CET) X-Virus-Scanned: amavisd-new at diku.dk Received: from mgw1.diku.dk ([127.0.0.1]) by localhost (mgw1.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Vf9xv6XVoR6f; Fri, 21 Nov 2008 20:35:32 +0100 (CET) Received: from nhugin.diku.dk (nhugin.diku.dk [130.225.96.140]) by mgw1.diku.dk (Postfix) with ESMTP id E5A8952C39A; Fri, 21 Nov 2008 20:35:32 +0100 (CET) Received: from ask.diku.dk (ask.diku.dk [130.225.96.225]) by nhugin.diku.dk (Postfix) with ESMTP id CCDA86DF8C8; Fri, 21 Nov 2008 20:33:31 +0100 (CET) Received: by ask.diku.dk (Postfix, from userid 3075) id C3B8E2724E6; Fri, 21 Nov 2008 20:35:32 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by ask.diku.dk (Postfix) with ESMTP id BE726272107; Fri, 21 Nov 2008 20:35:32 +0100 (CET) Date: Fri, 21 Nov 2008 20:35:32 +0100 (CET) From: Jesper Dangaard Brouer To: Thomas Gleixner Cc: Jesper Dangaard Brouer , David Miller , netdev , LKML , Robert Olsson , Ingo Molnar Subject: Re: Regression: Bisected, IRQ and MSI allocations screwed without sparse irq In-Reply-To: Message-ID: References: <1226572171.6834.87.camel@localhost.localdomain> <20081113.141513.116537651.davem@davemloft.net> <20081119.151138.93409143.davem@davemloft.net> <1227263614.25811.25.camel@localhost.localdomain> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, 21 Nov 2008, Thomas Gleixner wrote: > 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 ? It solves both the irq limit and the NIU driver unload bug. We should give it a good description. I have cooked up a patch with a description below, will you accept that? Who's tree do you want it to go upsteam via? (You are listed as one of the X86 maintainers, but Ingo's tree seems more up-to-date. My patch below is agains DaveM's tree) Cheers, Jesper Brouer --- ------------------------------------------------------------------- MSc. Master of Computer Science Dept. of Computer Science, University of Copenhagen Author of http://www.adsl-optimizer.dk ------------------------------------------------------------------- Fixing irq limit and NIU driver unload bug. Removing the config option HAVE_SPARSE_IRQ (commit 3235e936c0cc3589309280b6f59e5096779adae3) revealed a regression that limited the number of irqs on the system. Besides limiting the number of IRQ, this also caused unloading of the NIU driver to fail during msi_free_irqs(). The reduced number of IRQs caused the NIU driver to use "IO-APIC" based IRQs instead of "PCI-MSI-edge". This patch changes probe_nr_irqs() to return NR_IRQS, which is basically the same as the NOT CONFIG_X86_IO_APIC case. Thus being fairly safe. Thus, solving both the irq limit and the NIU driver unload bug. Tested-by: Jesper Dangaard Brouer Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Thomas Gleixner --- arch/x86/kernel/io_apic.c | 22 +--------------------- 1 files changed, 1 insertions(+), 21 deletions(-) diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c index c9513e1..1fec0f9 100644 --- a/arch/x86/kernel/io_apic.c +++ b/arch/x86/kernel/io_apic.c @@ -3608,27 +3608,7 @@ int __init io_apic_get_redir_entries (int ioapic) 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; } /* --------------------------------------------------------------------------