Skip to content

Commit 9233d2b

Browse files
Santosh Shilimkartorvalds
authored andcommitted
arch/arm/kernel/: use memblock apis for early memory allocations
Switch to memblock interfaces for early memory allocator instead of bootmem allocator. No functional change in beahvior than what it is in current code from bootmem users points of view. Archs already converted to NO_BOOTMEM now directly use memblock interfaces instead of bootmem wrappers build on top of memblock. And the archs which still uses bootmem, these new apis just fallback to exiting bootmem APIs. Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Christoph Lameter <cl@linux-foundation.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Grygorii Strashko <grygorii.strashko@ti.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Michal Hocko <mhocko@suse.cz> Cc: Paul Walmsley <paul@pwsan.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: Russell King <linux@arm.linux.org.uk> Cc: Tejun Heo <tj@kernel.org> Cc: Tony Lindgren <tony@atomide.com> Cc: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 4fc0bc5 commit 9233d2b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎arch/arm/kernel/devtree.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
3333

3434
void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
3535
{
36-
return alloc_bootmem_align(size, align);
36+
return memblock_virt_alloc(size, align);
3737
}
3838

3939
void __init arm_dt_memblock_reserve(void)

‎arch/arm/kernel/setup.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
717717
kernel_data.end = virt_to_phys(_end - 1);
718718

719719
for_each_memblock(memory, region) {
720-
res = alloc_bootmem_low(sizeof(*res));
720+
res = memblock_virt_alloc(sizeof(*res), 0);
721721
res->name = "System RAM";
722722
res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region));
723723
res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1;

0 commit comments

Comments
 (0)