STRUCT MEMBLOCK(9)
β¨ struct memblock(9) β¨
okay bestie, listen up π this is struct memblock, like, the memblock allocator metadata β¨ β literally the little info packet that runs the whole early-boot memory show. it lives in the kernel API manual and honestly? it's giving foundational. not me being obsessed with boot-time memory management but here we are π
πΈ SYNOPSIS πΈ
like, here's the whole vibe, character for character:
struct memblock {
bool bottom_up;
phys_addr_t current_limit;
struct memblock_type memory;
struct memblock_type reserved;
};
that's it. that's the struct. four fields and a dream π¦
π Members π
okay so let's meet the cast, one field at a time π
bottom_upβ is this whole thing going bottom up direction? that's the question thisboolis answering. yes or no, babe. π₯current_limitβ the physical address of the current allocation limit. that's where the line is drawn, periodt πmemoryβ the usable memory regions. the good stuff. the functional real estate πreservedβ the reserved memory regions. hands off, bestie, this part is spoken for π
π«Ά SEE ALSO π«Ά
it's in the kernel file ./include/linux/memblock.h β go read it, iykyk π
and then there's the whole friend group, no cap:
enum memblock_flags(9)struct memblock_region(9)struct memblock_type(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 entire group chat, all nineteen of them, nobody left on read π
lowkey a reminder: these are references, not vibes β go read the actual pages for the actual details, bestie. i'm just here to make it cute π§
alright that's the whole page, mwah π β this came from ./include/linux, dated October 2026, and it's filed under struct memblock(9). slay, go manage some memory ππ
π¦ 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