memblock_phys_free(9)
π memblock_phys_free(9) β Kernel API Manual, bestie edition β¨
okay so this is a page from the Kernel API Manual, and honestly? it's a little baddie with one job and it does it. it hands boot memory back to the system, and it does it flawlessly. let's get into it π«Ά
πΈ NAME πΈ
memblock_phys_free β free boot memory block
like, the whole personality is right there in the name. free. boot memory block. iconic, no notes π
β¨ SYNOPSIS β¨
int __init_memblock memblock_phys_free (phys_addr_t base , phys_addr_t size );
look at that signature. int return, __init_memblock annotation, two phys_addr_t args. it's giving "small function, big responsibilities" and we stan π
π ARGUMENTS π
baseβ the phys starting address of the boot memory block. like, where does this block even begin, bestie. this is the answer πsizeβ size of the boot memory block in bytes. yep, plain old bytes, no fancy units, no vibes-based measurement. just bytes π
π« DESCRIPTION π«
so here's the tea: this frees a boot memory block that was previously allocated by the memblock_phys_alloc_xx API. allocated it before? we're un-allocating it now. balance restored, karma clean β¨
and the detail you actually need to remember: if called after the buddy allocator is available, the memory is released to the buddy allocator. like, the buddy allocator is up and running, so the memory doesn't just vanish β it goes home to buddy. it's a whole handoff situation π€
π¦ SEE ALSO π¦
okay, this list is long, but every single one of these is a real one, so let's go. no skipping, we don't do that here π
- Kernel file
./mm/memblock.cmemblock overview(9) __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_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_alloc_or_panic(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)
that's the whole friend group. say hi to all of them or don't, but they're all in the group chat π
quick vibe check before you go: every name above is exactly as written, so if you're grepping for one, you've got the spelling right here. no autocorrect behavior in this house π
and that's the page, bestie!! π this one ships out of the ./mm source directory, version vibes dated October 2026 β so mark your calendar, screenshot this, send it to the group chat, and go free some boot memory πππ¦β¨π
π¦ 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