Re: [PATCH 11/35] lmb: Add find_memory_core_early()

From: Benjamin Herrenschmidt
Date: Fri May 14 2010 - 04:22:10 EST


On Thu, 2010-05-13 at 23:39 -0700, Yinghai wrote:
> > Oh and this wont' work on sparc. You should probably instead add a
> > lmb_find_in_nid() to lmb which shares code with lmb_alloc_nid().
>
> should work with sparc...
>
> + if (addr == LMB_ERROR)
> + continue;
>
> should do the trick.

Ugh ?

OK, I'll have to let Davem deal with the fine point of the sparc bits,
but I think basically sparc has CONFIG_ARCH_POPULATES_NODE_MAP set, but
the way it's NUMA affinity works, the early_node_map[] is crap, you
cannot rely on the ranges in there.

So it will "work" in the sense that you won't get errors, but the
allocations will -not- be node local. At least that's my understanding.

There's a reason we are adding node local allocations to LMB itself, so
it can deal with that during early boot, please use those and stop
trying to re-invent things slightly differently in ways that will not
work with various existing platforms.

> keep switch smooth. maybe later could try to replace that one by one.
> also i could use lmb_reserve_area() to take name and print out name to
> make debug easy.

I don't want those _area() variants. If you want to pass a name for
debugging purposes, then add it to lmb_reserve() or something like that
and fix the callers.

Cheers,
Ben.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/