aboutsummaryrefslogtreecommitdiffstats
path: root/mm/nobootmem.c
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2012-05-29 18:06:36 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-29 19:22:22 -0400
commit238305bb4d418c95977162ba13c11880685fc731 (patch)
tree43f578a711e85af44b1b1b43e8f32ef86490486f /mm/nobootmem.c
parente9079911e6c8fb7882de142de76f3ee49b54e000 (diff)
mm: remove sparsemem allocation details from the bootmem allocator
alloc_bootmem_section() derives allocation area constraints from the specified sparsemem section. This is a bit specific for a generic memory allocator like bootmem, though, so move it over to sparsemem. As __alloc_bootmem_node_nopanic() already retries failed allocations with relaxed area constraints, the fallback code in sparsemem.c can be removed and the code becomes a bit more compact overall. [akpm@linux-foundation.org: fix build] Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Tejun Heo <tj@kernel.org> Acked-by: David S. Miller <davem@davemloft.net> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Gavin Shan <shangw@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/nobootmem.c')
-rw-r--r--mm/nobootmem.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/mm/nobootmem.c b/mm/nobootmem.c
index 9f4048149f64..d23415c001bc 100644
--- a/mm/nobootmem.c
+++ b/mm/nobootmem.c
@@ -355,28 +355,6 @@ void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size,
355 return __alloc_bootmem_node(pgdat, size, align, goal); 355 return __alloc_bootmem_node(pgdat, size, align, goal);
356} 356}
357 357
358#ifdef CONFIG_SPARSEMEM
359/**
360 * alloc_bootmem_section - allocate boot memory from a specific section
361 * @size: size of the request in bytes
362 * @section_nr: sparse map section to allocate from
363 *
364 * Return NULL on failure.
365 */
366void * __init alloc_bootmem_section(unsigned long size,
367 unsigned long section_nr)
368{
369 unsigned long pfn, goal, limit;
370
371 pfn = section_nr_to_pfn(section_nr);
372 goal = pfn << PAGE_SHIFT;
373 limit = section_nr_to_pfn(section_nr + 1) << PAGE_SHIFT;
374
375 return __alloc_memory_core_early(early_pfn_to_nid(pfn), size,
376 SMP_CACHE_BYTES, goal, limit);
377}
378#endif
379
380#ifndef ARCH_LOW_ADDRESS_LIMIT 358#ifndef ARCH_LOW_ADDRESS_LIMIT
381#define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL 359#define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL
382#endif 360#endif