memblock_mark_mirror(9)
π memblock_mark_mirror(9)
okay so bestie, welcome to the Kernel API Manual β this one's memblock_mark_mirror(9) and it's honestly a little legend. it does exactly one thing and it does it slayfully: tags a chunk of your physical memory with the MEMBLOCK_MIRROR flag. that's it. that's the whole vibe. πͺβ¨
β¨ SYNOPSIS β¨
int __init_memblock memblock_mark_mirror (phys_addr_t base , phys_addr_t size );
like, look at that signature. __init_memblock, two phys_addr_ts, returns an int. clean. minimal. main character energy fr fr. π
πΈ ARGUMENTS πΈ
baseβ the base phys addr of the region π (yes, the physical address, not some virtual nonsense, keep up bestie)sizeβ the size of the region π (how big the vibe is, basically)
π RETURN π
0on success π₯³-errnoon failure π (so like, negative errno value, not "minus errno" as a concept β standard kernel sadness protocol)
π¦ SEE ALSO π¦
so there's a whole friend group here and you should lowkey meet all of them. first up, the source itself lives in the kernel file ./mm/memblock.c, and there's a memblock overview(9) that's basically the group chat pinned message:
__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_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)
ngl that's a lot of besties but they're all iconic in their own way, go say hi π
ok genuine reminder before you go: this page is filed under./mm, dated October 2026, and its title ismemblock_mark_mirror(9)β screenshot it, cite it, whatever, just don't lose the receipts π«Ά slay and stay marked πβπ
π¦ 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