__memblock_f...nge_top_down(9)
π
__memblock_find_range_top_down β Kernel API Manual β¨
okay bestie, so this page lives in the kernel API manual, the function is __memblock_find_range_top_down, and it's literally the finder-of-free-space that starts from the top and works its way down. no cap. π«Ά
β¨ NAME β¨
__memblock_find_range_top_down β find free area utility, in top-down π
π SYNOPSIS π
phys_addr_t __init_memblock __memblock_find_range_top_down (phys_addr_t
start , phys_addr_t end , phys_addr_t size , phys_addr_t align , int nid
, enum memblock_flags flags );
like, look at her. phys_addr_t return type, __init_memblock on the front, six whole arguments. main character energy honestly π
π ARGUMENTS π
startβ start of candidate range. the beginning, the origin story, where we start looking π¦endβ end of candidate range, and it can beMEMBLOCK_ALLOC_ANYWHEREorMEMBLOCK_ALLOC_ACCESSIBLE. yes those are the two special values, write them down πsizeβ size of free area to find. how much room you're hunting for, no more no less πalignβ alignment of free area to find. she has standards, the address must line up β¨nidβ nid of the free area to find, andNUMA_NO_NODEmeans "any node, idc, surprise me" πflagsβ pick from blocks based on memory attributes β
πΈ DESCRIPTION πΈ
so this is a utility that gets called from memblock_find_in_range_node, and it finds a free area top-down. that's it, that's the whole vibe. π
lowkey iconic how short this description is. the function does one thing and does it slay.
π RETURN π
Found address on success, 0 on failure. so like, if it comes back with 0? that's a no. that's a failure bestie, don't get it twisted π
π₯ SEE ALSO π₯
the whole memblock friend group, fr fr β every single one of them π
- Kernel file
./mm/memblock.c memblock overview(9)__memblock_find_range_bottom_up(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_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)
anyway that's the page!! this one comes from ./mm, dated October 2026, and it's filed under __memblock_f...nge_top_down(9) in the kernel API manual. go find your free area top-down and slay, bestie π
ππ
π¦ 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