Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755572AbYHCFjS (ORCPT ); Sun, 3 Aug 2008 01:39:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751573AbYHCFjF (ORCPT ); Sun, 3 Aug 2008 01:39:05 -0400 Received: from an-out-0708.google.com ([209.85.132.242]:50242 "EHLO an-out-0708.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751241AbYHCFjD (ORCPT ); Sun, 3 Aug 2008 01:39:03 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=vcZUo4H3/cWZeKyKZvyoMMNJAA2/CIe5RHeo1y8AtdL+3MQrk6o4stYkxGf+WyKXeP CzSLvS7IsN2mDw7N7+ArExeBtFNGQ99+vK3vVlirtXAB9sp3v6Mf8hFjyhsfKc2NVcXz oeMv9HH8bZOFQRrZ8OkDoOxIUO48YqoNUanGI= Message-ID: <86802c440808022239i447f9627t98e5867b0b08e709@mail.gmail.com> Date: Sat, 2 Aug 2008 22:39:01 -0700 From: "Yinghai Lu" To: "Johannes Weiner" Subject: Re: [PATCH 03/25] add dyn_array support Cc: "Ingo Molnar" , "Thomas Gleixner" , "H. Peter Anvin" , "Eric W. Biederman" , "Dhaval Giani" , "Mike Travis" , "Andrew Morton" , linux-kernel@vger.kernel.org In-Reply-To: <87od4a1x6y.fsf@saeurebad.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1217732365-16595-1-git-send-email-yhlu.kernel@gmail.com> <1217732365-16595-2-git-send-email-yhlu.kernel@gmail.com> <1217732365-16595-3-git-send-email-yhlu.kernel@gmail.com> <1217732365-16595-4-git-send-email-yhlu.kernel@gmail.com> <871w163fuw.fsf@saeurebad.de> <86802c440808022121u3dcdbda2s5ff463f4b330ca17@mail.gmail.com> <87sktm1yuu.fsf@saeurebad.de> <86802c440808022204s62ff2b35g391125babdb2e8e4@mail.gmail.com> <87od4a1x6y.fsf@saeurebad.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1784 Lines: 56 On Sat, Aug 2, 2008 at 10:31 PM, Johannes Weiner wrote: > Hi, > > "Yinghai Lu" writes: > >> On Sat, Aug 2, 2008 at 9:55 PM, Johannes Weiner wrote: >>> Hi, >>> >>> "Yinghai Lu" writes: >>> >>>> On Sat, Aug 2, 2008 at 9:03 PM, Johannes Weiner wrote: >>>>> Hi, >>>>> >>>>> Yinghai Lu writes: >>>>> >>>>>> could have crazy big arrays and allocate them in bootmem at init stage. >>>>>> also also to allocate array according to size we need to use to avoid wasting >>>>>> memory >>>>>> use CONFIG_HAVE_DYN_ARRAY to enable it or not >>>>>> >>>>>> usage: >>>>>> >>>>>> |static struct irq_desc irq_desc_init __initdata = { >>>>>> | .status = IRQ_DISABLED, >>>>>> | .chip = &no_irq_chip, >>>>>> | .handle_irq = handle_bad_irq, >>>>>> | .depth = 1, >>>>>> | .lock = __SPIN_LOCK_UNLOCKED(irq_desc->lock), >>>>>> |#ifdef CONFIG_SMP >>>>>> | .affinity = CPU_MASK_ALL >>>>>> |#endif >>>>>> |}; >>>>>> | >>>>>> |static void __init init_work(void *data) >>>>>> |{ >>>>>> | struct dyn_array *da = data; >>>>>> | struct irq_desc *desc; >>>>>> | int i; >>>>>> | >>>>>> | desc = *da->name; >>>>> >>>>> Where *da->name might be NULL... >> >> *da->name = __alloc_bootmem_nopanic(size, da->align, phys); > > Exactly. Now, look up the possible return values of > __alloc_bootmem_nopanic and we are almost there... 04 fix that via allocating that all together 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/