[lkml]   [2010]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 26/39] nobootmem: use lmb.default_alloc_limit in alloc_bootmem path
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

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)

return addr;

return -1ULL;

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.


 \ /
  Last update: 2010-04-13 06:57    [W:0.083 / U:0.676 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site