From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yinghai Subject: Re: [PATCH 26/39] nobootmem: use lmb.default_alloc_limit in alloc_bootmem path Date: Mon, 12 Apr 2010 21:50:50 -0700 Message-ID: <4BC3F82A.20400@oracle.com> References: <1270793048-23796-1-git-send-email-yinghai@kernel.org> <1270793048-23796-27-git-send-email-yinghai@kernel.org> <1271132589.13059.67.camel@pasglop> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: Received: from rcsinet11.oracle.com ([148.87.113.123]:46005 "EHLO rcsinet11.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751499Ab0DMEy3 (ORCPT ); Tue, 13 Apr 2010 00:54:29 -0400 In-Reply-To: <1271132589.13059.67.camel@pasglop> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Benjamin Herrenschmidt 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 04/12/2010 09:23 PM, Benjamin Herrenschmidt wrote: > On Thu, 2010-04-08 at 23:03 -0700, Yinghai Lu wrote: >> Generic version __lmb_find_area() is going from high to low, and for 32bit >> active_region for 32bit does include high pages >> >> need to replace the limit with lmb.default_alloc_limit, aka get_max_mapped() >> >> with this patch, x86 32bit could use generic version of __lmb_find_area() > > So you unconditionally add access to some lmb specific data structure to > generic code ? That isn't going to work very well on archs that don't > use lmb. the whole function #ifdef CONFIG_HAVE_LMB u64 __init find_memory_core_early(int nid, u64 size, u64 align, u64 goal, u64 limit) { int i; /* Need to go over early_node_map to find out good range for node */ for_each_active_range_index_in_nid(i, nid) { u64 addr; u64 ei_start, ei_last; ei_last = early_node_map[i].end_pfn; ei_last <<= PAGE_SHIFT; ei_start = early_node_map[i].start_pfn; ei_start <<= PAGE_SHIFT; addr = __lmb_find_area(ei_start, ei_last, goal, limit, size, align); if (addr == -1ULL) continue; return addr; } return -1ULL; } #endif need to access early_node_map[], so leave the function here. > > Also, those things should be local to lmb_* anyways. if you insist, could move it to lmb.c and use work_with_active_regions() around it. YH