[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4C4FC2CB.6040200@kernel.org>
Date: Tue, 27 Jul 2010 22:40:27 -0700
From: Yinghai Lu <yinghai@...nel.org>
To: Benjamin Herrenschmidt <benh@...nel.crashing.org>
CC: Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>,
Andrew Morton <akpm@...ux-foundation.org>,
David Miller <davem@...emloft.net>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>,
linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org
Subject: Re: [PATCH 03/16] x86, memblock: Add memblock_x86_to_bootmem()
On 07/27/2010 10:00 PM, Benjamin Herrenschmidt wrote:
> On Thu, 2010-07-22 at 11:43 -0700, Yinghai Lu wrote:
>> memblock_x86_to_bootmem() will reserve memblock.reserved.region in bootmem after bootmem is
>
>> +#ifndef CONFIG_NO_BOOTMEM
>> +void __init memblock_x86_to_bootmem(u64 start, u64 end)
>> +{
>> + int count;
>> + u64 final_start, final_end;
>> + struct memblock_region *r;
>> +
>> + /* Take out region array itself */
>> + if (memblock.reserved.regions != memblock_reserved_init_regions)
>> + memblock_free(__pa(memblock.reserved.regions), sizeof(struct memblock_region) * memblock.reserved.max);
>
> So that's why you export memblock_reserved_init_regions...
>
> I really -really- don't like it. First of all, it's really gross to
> free the array then walk it. We know it won't race but still ...
> especially since you re-do the above every time
> memblock_x86_to_bootmem() is called. Is it called more than once ? If
> yes, then it's bogus. If not, then why have start,end ?
only one time for x86.
>
> If you really want to free it, maybe best is to stick something in
> mm/memblock.c that kicks in at late init time and does the freeing ?
>
> I'm going to keep the exporting out of my branch for now. If you really
> want it, you can always add it to this specific patch, but it sucks.
Actually the last patch remove this bootmem support for x86, so this function get removed later.
Thanks
Yinghai
--
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