STRUCT MEMBLOCK_REGION(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct memblock_region(9) β€” kernel API manual, bestie edition πŸŽ€

Okay so this is a page from the Kernel API Manual, and today's main character is struct memblock_region. Pull up a chair, grab a strawberry, we're doing this. πŸ“


✨ NAME ✨

struct memblock_region β€” the struct that represents a memory region. That's it, that's the whole vibe. It's giving "one little box that says where memory lives." πŸ¦‹


🌸 SYNOPSIS 🌸

struct memblock_region {
    phys_addr_t base;
    phys_addr_t size;
    enum memblock_flags flags;
  #ifdef CONFIG_NUMA;
    int nid;
  #endif;
 };

Like?? The cutest little struct?? Notice how nid is literally only in the group chat if CONFIG_NUMA is there β€” conditional membership, we love to see it. πŸ‘‘


πŸ’– Members πŸ’–

  • base β€” base address of the region. Where it starts, no cap. πŸ“
  • size β€” size of the region. How much room it's taking up, iykyk. πŸ“
  • flags β€” memory region attributes. All the little labels and traits it's carrying around. 🏷️
  • nid β€” NUMA node id. Which node it's repping, basically. Only shows up when CONFIG_NUMA is enabled (see the synopsis, bestie β€” it's inside that #ifdef). 🌈

πŸ”₯ SEE ALSO πŸ”₯

These are the friends, the mutuals, the whole crew. All of them, no skipping:

Kernel file ./include/linux/memblock.h β€” enum memblock_flags(9), struct memblock_type(9), struct memblock(9), for_each_physmem_range(9), __for_each_mem_range(9), __for_each_mem_range_rev(9), for_each_mem_range(9), for_each_mem_range_rev(9), for_each_reserved_mem_range(9), for_each_mem_pfn_range(9), for_each_free_mem_range(9), for_each_free_mem_range_reverse(9), memblock_set_current_limit(9), memblock_region_memory_base_pfn(9), memblock_region_memory_end_pfn(9), memblock_region_reserved_base_pfn(9), memblock_region_reserved_end_pfn(9), for_each_mem_region(9), for_each_reserved_mem_region(9)

That's the whole page, periodt. πŸ’… Signing off from ./include/linux, dated October 2026, and yes the footer still calls it struct memblock_region(9) because some things are iconic and never change. 🫢✨

πŸ“¦ where this page comes from