memblock_alloc_try_nid_raw(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– memblock_alloc_try_nid_raw(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual ✨ β€” this one's a lil function called memblock_alloc_try_nid_raw, and no cap the name is a whole mouthful but it's literally gonna be your new fave. It's giving "allocate boot memory block" energy, except it does not zero the memory and it does not panic. periodt. πŸŽ€


🌸 SYNOPSIS 🌸

void * memblock_alloc_try_nid_raw (phys_addr_t size , phys_addr_t align
, phys_addr_t min_addr , phys_addr_t max_addr , int nid );

like… yes, five arguments. she's high-maintenance but she slays πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • size β€” the size of the memory block you wanna allocate, in bytes. like how much memory you're asking for, fr fr.
  • align β€” the alignment of the region and the block's size. both. she's thorough. ✨
  • min_addr β€” the lower bound of the memory region where you'd prefer the allocation to come from (phys address). lowkey the floor of the vibe check.
  • max_addr β€” the upper bound of the memory region where you'd prefer the allocation to come from (phys address) β€” OR you can pass MEMBLOCK_ALLOC_ACCESSIBLE and it'll allocate only from memory limited by the memblock.current_limit value. iykyk 😌
  • nid β€” the nid of the free area to find. want any node? pass NUMA_NO_NODE. easy. 🫢

🧚 DESCRIPTION 🧚

so this is a public function, and it provides additional debug information (including caller info) if enabled. cute, right? πŸ™ˆ

here's the part you gotta remember tho, bestie:

it does not zero the allocated memory, and it does not panic if the request cannot be satisfied. πŸ’€

like, she's chill about it. no drama, no meltdown, no zeroing. you asked, she tried, that's the vibe.


πŸ‘‘ RETURN πŸ‘‘

  • on success β†’ the virtual address of the allocated memory block πŸŽ‰
  • on failure β†’ NULL 😭

that's it. that's the whole return situation.


🌈 SEE ALSO 🌈

buckle up bestie, this list is long β€” but every single one of these is iconic in her own way:


okay that's the whole page, you ate that πŸ“ go forth and allocate responsibly, bestie πŸ’œ

β€” xoxo, from ./mm, October 2026, memblock_alloc_try_nid_raw(9) signing off πŸŽ€βœ¨

πŸ“¦ where this page comes from