From 9224237a87e9f023f5dbe6d7e0a126506aa46773 Mon Sep 17 00:00:00 2001 From: Yinghai Lu Date: Thu, 24 Feb 2011 14:43:06 +0100 Subject: [PATCH] --- yaml --- r: 234889 b: refs/heads/master c: 8bc1f91e1f0e977fb95b11d8fa686f5091888110 h: refs/heads/master i: 234887: 4a31660ef97c088cc428024950c5589e7e8d9801 v: v3 --- [refs] | 2 +- trunk/include/linux/mm.h | 2 -- trunk/mm/nobootmem.c | 25 +++++++++++++++++++++++++ trunk/mm/page_alloc.c | 28 ---------------------------- 4 files changed, 26 insertions(+), 31 deletions(-) diff --git a/[refs] b/[refs] index f96e95b6c7cd..7495dd080895 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e782ab421bbba1912c87934bd0e8998630736418 +refs/heads/master: 8bc1f91e1f0e977fb95b11d8fa686f5091888110 diff --git a/trunk/include/linux/mm.h b/trunk/include/linux/mm.h index f6385fc17ad4..679300c050f5 100644 --- a/trunk/include/linux/mm.h +++ b/trunk/include/linux/mm.h @@ -1309,8 +1309,6 @@ int add_from_early_node_map(struct range *range, int az, int nr_range, int nid); u64 __init find_memory_core_early(int nid, u64 size, u64 align, u64 goal, u64 limit); -void *__alloc_memory_core_early(int nodeid, u64 size, u64 align, - u64 goal, u64 limit); typedef int (*work_fn_t)(unsigned long, unsigned long, void *); extern void work_with_active_regions(int nid, work_fn_t work_fn, void *data); extern void sparse_memory_present_with_active_regions(int nid); diff --git a/trunk/mm/nobootmem.c b/trunk/mm/nobootmem.c index 6a018e49b7be..e2bdb07079ce 100644 --- a/trunk/mm/nobootmem.c +++ b/trunk/mm/nobootmem.c @@ -40,6 +40,31 @@ unsigned long max_pfn; unsigned long saved_max_pfn; #endif +static void * __init __alloc_memory_core_early(int nid, u64 size, u64 align, + u64 goal, u64 limit) +{ + void *ptr; + u64 addr; + + if (limit > memblock.current_limit) + limit = memblock.current_limit; + + addr = find_memory_core_early(nid, size, align, goal, limit); + + if (addr == MEMBLOCK_ERROR) + return NULL; + + ptr = phys_to_virt(addr); + memset(ptr, 0, size); + memblock_x86_reserve_range(addr, addr + size, "BOOTMEM"); + /* + * The min_count is set to 0 so that bootmem allocated blocks + * are never reported as leaks. + */ + kmemleak_alloc(ptr, size, 0, 0); + return ptr; +} + /* * free_bootmem_late - free bootmem pages directly to page allocator * @addr: starting address of the range diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index a243a7fd6922..603513609ba5 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -3780,34 +3780,6 @@ int __init add_from_early_node_map(struct range *range, int az, return nr_range; } -#ifdef CONFIG_NO_BOOTMEM -void * __init __alloc_memory_core_early(int nid, u64 size, u64 align, - u64 goal, u64 limit) -{ - void *ptr; - u64 addr; - - if (limit > memblock.current_limit) - limit = memblock.current_limit; - - addr = find_memory_core_early(nid, size, align, goal, limit); - - if (addr == MEMBLOCK_ERROR) - return NULL; - - ptr = phys_to_virt(addr); - memset(ptr, 0, size); - memblock_x86_reserve_range(addr, addr + size, "BOOTMEM"); - /* - * The min_count is set to 0 so that bootmem allocated blocks - * are never reported as leaks. - */ - kmemleak_alloc(ptr, size, 0, 0); - return ptr; -} -#endif - - void __init work_with_active_regions(int nid, work_fn_t work_fn, void *data) { int i;