Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753863Ab0ADTDR (ORCPT ); Mon, 4 Jan 2010 14:03:17 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753645Ab0ADTDJ (ORCPT ); Mon, 4 Jan 2010 14:03:09 -0500 Received: from mail-px0-f174.google.com ([209.85.216.174]:41992 "EHLO mail-px0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753409Ab0ADTDG convert rfc822-to-8bit (ORCPT ); Mon, 4 Jan 2010 14:03:06 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=mB0r23C8mmsWaMBXV04zzU1x/sElXRb0XesksEf46Xx4GjJHVJ2m3Sb9V4dsXRn4E3 xUh9gqQivXtw5dnNtvTXC1Yr1Bf+wE490A9d3yFcehpyQyX/xO0fiPVUlQrjsk6mgchn rqPXJxAmWTqmGICCv5ig4GJGjtE7+7LlZqia4= MIME-Version: 1.0 In-Reply-To: References: <4B347AEE.6030705@kernel.org> <20091228094707.GH24690@elte.hu> <4B398ECD.1080506@kernel.org> <4807377b1001031906s6b1ee576jc021da2642bb4147@mail.gmail.com> <4B415E73.1050801@kernel.org> <4B41918D.3000605@kernel.org> Date: Mon, 4 Jan 2010 11:03:02 -0800 X-Google-Sender-Auth: fc3c67f6be0686f8 Message-ID: <86802c441001041103s5abd6d3ai4e6ccbfc68323f3c@mail.gmail.com> Subject: Re: [PATCH 2/2] x86: get more exact nr_irqs From: Yinghai Lu To: "Eric W. Biederman" Cc: Jesse Brandeburg , Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , "linux-kernel@vger.kernel.org" , Andrew Morton , NetDEV list , Jesse Brandeburg Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1604 Lines: 49 On Mon, Jan 4, 2010 at 8:55 AM, Eric W. Biederman wrote: > Yinghai Lu writes: > >> first check with NR_VECTORS - FIRST_EXTERNAL_VECTOR - 0x20 >> aka minus exceptions and system vectors. >> >> NR_CPUS = 512, and nr_cpu_ids = 128 >> will have NR_IRQS = 256 + 512 * 64 = 33024 >> >> assume we have 20 intel ixgbe 6 port cards (with sriov and ixgbevf) >> ? ? ? 20 * 6 * 64 * 3 = 23040 >> >> first will get: >> ? ? ? 128 * (256 - 64) = 24576 >> then with nr_irqs_gsi will get >> ? ? ? (120 + 8 * 128 + 120 * 256) = 31864 >> >> so 24576 will be used for nr_irqs. >> >> 24576 * 8 = 196608 bytes will be used for irq_desc_ptrs[] >> >> before this patch: >> ? ? have nr_irqs = 120 + 8 * 128 + 120 * 64 = 8824 >> ? ? ? and irq_desc_ptrs[] is 70592 >> >> Signed-off-by: Yinghai Lu > > I am lost. ? ?arch_probe_nr_irqs appears to be total nonsense. > > We have three concepts. > - The number of irq sources we can talk about. ?( nr_irqs) > - The number of irqs we can possibly service. ? ((NR_VECTORS - 0x30) *nr_cpu_ids) > - The number of irqs we actually connected up to cards in the > ?system that we need to do something with. > > Why do we need to allocate arrays at all? > irq_desc is allocated dynamically. but irq_desc_ptrs is pointer array, it need to be allocated after nr_irqs is probed. YH -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/