From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: [PATCH 11/35] lmb: Add find_memory_core_early() Date: Fri, 14 May 2010 18:19:47 +1000 Message-ID: <1273825187.21352.590.camel@pasglop> References: <1273796396-29649-1-git-send-email-yinghai@kernel.org> <1273796396-29649-12-git-send-email-yinghai@kernel.org> <1273804238.21352.389.camel@pasglop> <4BECF00D.6080800@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: Received: from gate.crashing.org ([63.228.1.57]:53653 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754271Ab0ENIWA (ORCPT ); Fri, 14 May 2010 04:22:00 -0400 In-Reply-To: <4BECF00D.6080800@oracle.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Yinghai Cc: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andrew Morton , David Miller , Linus Torvalds , Johannes Weiner , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org 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.