Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756259AbYHCFsr (ORCPT ); Sun, 3 Aug 2008 01:48:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751573AbYHCFsj (ORCPT ); Sun, 3 Aug 2008 01:48:39 -0400 Received: from an-out-0708.google.com ([209.85.132.246]:56176 "EHLO an-out-0708.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751241AbYHCFsi (ORCPT ); Sun, 3 Aug 2008 01:48:38 -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=snpjrt2ccueuVwjvHXaM49jngSexYcVzcxhwSHjRTncU4KGJFn90BaKtdetoGdWGEO ++jAHiajCQgz2pQjoLNQa5Ck9IYxRzu3dHLOTLlDH5zt+uyTBYWlC6Vd/q6vLa3RBmO6 8UT5gB/ycAT1GhkWtR7QM4rUhniDC1d/fHzEo= Message-ID: <86802c440808022248g261f98bcp48042fe845751059@mail.gmail.com> Date: Sat, 2 Aug 2008 22:48:37 -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: <87k5ey1wgp.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-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> <86802c440808022239i447f9627t98e5867b0b08e709@mail.gmail.com> <87k5ey1wgp.fsf@saeurebad.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2254 Lines: 67 On Sat, Aug 2, 2008 at 10:47 PM, Johannes Weiner wrote: > Hi, > > "Yinghai Lu" writes: > >> 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 > > No patch should introduce wrong behaviour but instead be an atomic > switch to another working state. If 4 gets reverted for any reason > whatsoever, you will be left with a buggy version. ok, next version i will remove _nopanic 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/