mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
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. [[email protected]: fix build] Signed-off-by: Johannes Weiner <[email protected]> Acked-by: Tejun Heo <[email protected]> Acked-by: David S. Miller <[email protected]> Cc: Yinghai Lu <[email protected]> Cc: Gavin Shan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
e9079911e6
commit
238305bb4d
4 changed files with 12 additions and 60 deletions
22
mm/bootmem.c
22
mm/bootmem.c
|
|
@ -803,28 +803,6 @@ void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size,
|
|||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPARSEMEM
|
||||
/**
|
||||
* alloc_bootmem_section - allocate boot memory from a specific section
|
||||
* @size: size of the request in bytes
|
||||
* @section_nr: sparse map section to allocate from
|
||||
*
|
||||
* Return NULL on failure.
|
||||
*/
|
||||
void * __init alloc_bootmem_section(unsigned long size,
|
||||
unsigned long section_nr)
|
||||
{
|
||||
bootmem_data_t *bdata;
|
||||
unsigned long pfn, goal;
|
||||
|
||||
pfn = section_nr_to_pfn(section_nr);
|
||||
goal = pfn << PAGE_SHIFT;
|
||||
bdata = &bootmem_node_data[early_pfn_to_nid(pfn)];
|
||||
|
||||
return alloc_bootmem_bdata(bdata, size, SMP_CACHE_BYTES, goal, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef ARCH_LOW_ADDRESS_LIMIT
|
||||
#define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue