On Sat, 2010-05-08 at 08:17 -0700, Yinghai Lu wrote:
This is clumsy. Doesn't work with NUMA either. Also,
reserve_bootmem_generic() only exists on x86 afaik.
I also disagree with the clearing of the region, I'd like
to keep the arrays around for debug purposes, especially since
I'm going to expose them in debugfs, but I suppose we can make
that an option. In any case, I don't think it's the right place
to introduce such a "side effect".
In any case, I'm not convinced there's much interrest at this
stage in putting that code in the generic lmb.c, with my patches
this stuff boils down to:
for_each_lmb(reserved, reg) {
unsigned long top = reg->base + reg->size - 1;
if (top < lowmem_end_addr)
reserve_bootmem(reg->base, reg->size, BOOTMEM_DEFAULT);
else if (reg->base < lowmem_end_addr) {
unsigned long trunc_size = lowmem_end_addr - reg->base;
reserve_bootmem(reg->base, trunc_size, BOOTMEM_DEFAULT);
}
}
In the non-numa case, but let's keep that in arch for now. We might be
able to reconcile the NUMA case, I'm looking at that, it's non trivial,
in which case that stuff would become a better candidate for being in
the generic code, but not for now.
Cheers,
Ben.
--