Commit 8b89a116 authored by Grygorii Strashko's avatar Grygorii Strashko Committed by Linus Torvalds
Browse files

mm/hugetlb.c: 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: default avatarGrygorii Strashko <>
Signed-off-by: default avatarSantosh Shilimkar <>
Cc: "Rafael J. Wysocki" <>
Cc: Arnd Bergmann <>
Cc: Christoph Lameter <>
Cc: Greg Kroah-Hartman <>
Cc: H. Peter Anvin <>
Cc: Johannes Weiner <>
Cc: KAMEZAWA Hiroyuki <>
Cc: Konrad Rzeszutek Wilk <>
Cc: Michal Hocko <>
Cc: Paul Walmsley <>
Cc: Pavel Machek <>
Cc: Russell King <>
Cc: Tejun Heo <>
Cc: Tony Lindgren <>
Cc: Yinghai Lu <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent bb016b84
......@@ -1271,9 +1271,9 @@ int __weak alloc_bootmem_huge_page(struct hstate *h)
for_each_node_mask_to_alloc(h, nr_nodes, node, &node_states[N_MEMORY]) {
void *addr;
addr = __alloc_bootmem_node_nopanic(NODE_DATA(node),
huge_page_size(h), huge_page_size(h), 0);
addr = memblock_virt_alloc_try_nid_nopanic(
huge_page_size(h), huge_page_size(h),
if (addr) {
* Use the beginning of the huge page to store the
......@@ -1313,8 +1313,8 @@ static void __init gather_bootmem_prealloc(void)
page = pfn_to_page(m->phys >> PAGE_SHIFT);
free_bootmem_late((unsigned long)m,
sizeof(struct huge_bootmem_page));
sizeof(struct huge_bootmem_page));
page = virt_to_page(m);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment