memblock_merge_regions(9)
π« memblock_merge_regions(9) π«
okay so welcome to the Kernel API Manual bestie, today's episode is genuinely so satisfying β we're talking about memblock_merge_regions, which is literally the "let me just tidy up in here" function of the memblock world β¨
πΈ NAME πΈ
memblock_merge_regions β merge neighboring compatible regions π«Ά (yes that's it, that's the whole vibe, she cleans up the friend groups so nobody's sitting alone at the lunch table)
π SYNOPSIS π
void __init_memblock memblock_merge_regions (struct memblock_type *type
, unsigned long start_rgn , unsigned long end_rgn );
like, look at her. no return value, she just does it π
π¦ ARGUMENTS π¦
typeβ the memblock type you want her to scan π like, which pile are we tidyingstart_rgnβ start scanning from(start_rgn - 1)β yes bestie, minus one, that's not a typo, that's the actual spec πend_rgnβ end scanning at(end_rgn - 1). So basically: scantypeand merge neighboring compatible regions in[start_rgn - 1, end_rgn)β note the square bracket on the left and the round bracket on the right, that's a half-open interval and she's not being vague about it
ngl the- 1thing on both ends is doing a lot of work here. just... read it twice, screenshot it, whatever you need. it'sstart_rgn - 1andend_rgn - 1. periodt π
π SEE ALSO π
okay this list is long and honestly iconic for it, so buckle up bestie, we're going through the whole friend group π§
Kernel file ./mm/memblock.c π β plus memblock 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_insert_region(9) (her direct coworker fr fr), 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) π₯
and that's the whole page!! no cap, she's short and sweet and she just merges the neighboring compatible regions and leaves π
sign-off era: this gorgeous little page came from the source in ./mm π, and it's dated October 2026 ποΈ β so yeah, future-dated queen behavior π bye bestie, go merge something π¦β¨
π¦ 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