memblock_is_region_memory(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… memblock_is_region_memory(9) β€” from the Kernel API Manual, bestie πŸŽ€

okay so picture this: you're poking around in the kernel's memblock code (like ./mm/memblock.c, iykyk) and you need to know whether some random region of physical addresses is actually part of real memory. That's literally the whole gig of memblock_is_region_memory. No cap. ✨


🌸 NAME 🌸

memblock_is_region_memory β€” check if a region is a subset of memory 🫢


✨ SYNOPSIS ✨

bool __init_memblock memblock_is_region_memory (phys_addr_t base ,
       phys_addr_t size );

like, it takes two phys_addr_t args and hands you back a bool. iconic behaviour honestly πŸ‘‘


🧚 ARGUMENTS 🧚

  • base β€” base of region to check. the starting address of the region you're vibe-checking πŸ’–
  • size β€” size of region to check. how big that region is, fr fr 🌸

πŸ¦‹ DESCRIPTION πŸ¦‹

Check if the region [base, base + size) is a subset of a memory block.

that's it, that's the whole thing. it's giving "one job, done perfectly." the region starts at base and runs up to (but not including, bestie β€” that's what the ) is for πŸ’…) base + size, and this function tells you whether all of that sits inside a memory block. obsessed. 🌈


⭐ RETURN ⭐

0 if false, non-zero if true. classic. no surprises, no drama, just truthiness 😌


πŸ’œ SEE ALSO πŸ’œ

Kernel file ./mm/memblock.c 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_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_reserved(9), memblock_free_all(9), reserve_mem_find_by_name(9), reserve_mem_release_by_name(9)

(yeah that's a lot of friends. the memblock family is huge and they all ate πŸ’€πŸ”₯ go read them too, i'm begging)


ngl this one's short and sweet β€” but don't sleep on it, memory region checks are main character energy in the boot path πŸ‘‘

and that's a wrap, bestie 🫢 this page came from ./mm, October 2026 β€” mwah, go check a region, slay πŸ’…βœ¨πŸ“

πŸ“¦ where this page comes from