__memblock_alloc_or_panic(9)
πΈ NAME πΈ
__memblock_alloc_or_panic β Try to allocate memory and panic on failure.
okay so this is the __memblock_alloc_or_panic(9) page from the Kernel API Manual β¨ and the name is literally giving the whole plot: it tries to allocate memory, and if that fails, it panics ππ
.
β¨ SYNOPSIS β¨
void * __memblock_alloc_or_panic (phys_addr_t size , phys_addr_t align ,
const char *func );
π ARGUMENTS π
sizeβ size of memory block to be allocated in bytes. literally how many bytes you're asking for, bestie πalignβ alignment of the region and block's size. this is the alignment of the region and block's size, periodt β¨funcβ caller func name. the caller func name, for the record π«Ά
π DESCRIPTION π
This function attempts to allocate memory using memblock_alloc, and in case of failure, it calls panic with the formatted message. So yeah: it tries, and if it fails, it does not ghost you β it calls panic with the formatted message ππ₯.
This function should not be used directly, please use the macro memblock_alloc_or_panic. That's the important bit: do not call this one directly, use the macro memblock_alloc_or_panic instead, iykyk π.
π¦ SEE ALSO π¦
the whole crew starts with Kernel file ./mm/memblock.c memblock overview(9), then:
__memblock_find_range_bottom_up(9)__memblock_find_range_top_down(9)memblock_find_in_range_node(9)memblock_find_in_range(9)memblock_discard(9)memblock_double_array(9)memblock_merge_regions(9)memblock_insert_region(9)memblock_add_range(9)memblock_add_node(9)memblock_add(9)memblock_validate_numa_coverage(9)memblock_isolate_range(9)memblock_free(9)memblock_phys_free(9)memblock_setclr_flag(9)memblock_mark_hotplug(9)memblock_clear_hotplug(9)memblock_mark_mirror(9)memblock_mark_nomap(9)memblock_clear_nomap(9)memblock_reserved_mark_noinit(9)memblock_reserved_mark_kern(9)memblock_mark_kho_scratch(9)memblock_clear_kho_scratch(9)__next_mem_range(9)__next_mem_range_rev(9)memblock_set_node(9)memblock_alloc_range_nid(9)memblock_phys_alloc_range(9)memblock_phys_alloc_try_nid(9)memblock_alloc_internal(9)memblock_alloc_exact_nid_raw(9)memblock_alloc_try_nid_raw(9)memblock_alloc_hugetlb(9)memblock_alloc_try_nid(9)memblock_estimated_nr_free_pages(9)memblock_is_region_memory(9)memblock_is_region_reserved(9)memblock_free_all(9)reserve_mem_find_by_name(9)reserve_mem_release_by_name(9)
and that's the whole page, bestie π source/version ./mm, date October 2026, and yes, __memblock_alloc_or_panic(9) is iconic. periodt π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms