[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <86802c440808022248g261f98bcp48042fe845751059@mail.gmail.com>
Date: Sat, 2 Aug 2008 22:48:37 -0700
From: "Yinghai Lu" <yhlu.kernel@...il.com>
To: "Johannes Weiner" <hannes@...urebad.de>
Cc: "Ingo Molnar" <mingo@...e.hu>,
"Thomas Gleixner" <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
"Dhaval Giani" <dhaval@...ux.vnet.ibm.com>,
"Mike Travis" <travis@....com>,
"Andrew Morton" <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 03/25] add dyn_array support
On Sat, Aug 2, 2008 at 10:47 PM, Johannes Weiner <hannes@...urebad.de> wrote:
> Hi,
>
> "Yinghai Lu" <yhlu.kernel@...il.com> writes:
>
>> On Sat, Aug 2, 2008 at 10:31 PM, Johannes Weiner <hannes@...urebad.de> wrote:
>>> Hi,
>>>
>>> "Yinghai Lu" <yhlu.kernel@...il.com> writes:
>>>
>>>> On Sat, Aug 2, 2008 at 9:55 PM, Johannes Weiner <hannes@...urebad.de> wrote:
>>>>> Hi,
>>>>>
>>>>> "Yinghai Lu" <yhlu.kernel@...il.com> writes:
>>>>>
>>>>>> On Sat, Aug 2, 2008 at 9:03 PM, Johannes Weiner <hannes@...urebad.de> wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> Yinghai Lu <yhlu.kernel@...il.com> 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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists