Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234889
b: refs/heads/master
c: 8bc1f91
h: refs/heads/master
i:
  234887: 4a31660
v: v3
  • Loading branch information
Yinghai Lu authored and Tejun Heo committed Feb 24, 2011
1 parent fbdd433 commit 9224237
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 31 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e782ab421bbba1912c87934bd0e8998630736418
refs/heads/master: 8bc1f91e1f0e977fb95b11d8fa686f5091888110
2 changes: 0 additions & 2 deletions trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
25 changes: 25 additions & 0 deletions trunk/mm/nobootmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 0 additions & 28 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9224237

Please sign in to comment.