memblock_phys_alloc_try_nid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– memblock_phys_alloc_try_nid(9) β€” Kernel API Manual ✨

okay so bestie, welcome to the glow-up era of the kernel's physical memory allocator πŸŽ€ this one lives in the Kernel API Manual, and honestly? she's that girl. let's get into it πŸ’…


🌸 NAME 🌸

memblock_phys_alloc_try_nid β€” grab a memory block from a NUMA node you pick, and if that node's being stingy, she'll try literally anywhere πŸ’€


πŸ¦‹ SYNOPSIS πŸ¦‹

phys_addr_t memblock_phys_alloc_try_nid (phys_addr_t size , phys_addr_t
align , int nid );

✨ ARGUMENTS ✨

  • size β€” how big your memory block is, in bytes. that's the whole vibe check πŸ“
  • align β€” the alignment of the region and the block's size. picky picky, she likes things lined up just right πŸ’…
  • nid β€” the nid of the free area to find. pass NUMA_NO_NODE if you're in your "any node is fine, i'm not picky today" era πŸ™ˆ

πŸ’œ DESCRIPTION πŸ’œ

Allocates a memory block from the specified NUMA node β€” very "i know exactly what i want" of her, love that for her πŸ‘‘

But bestie, if that node has no available memory? she does not spiral. she simply attempts to allocate from any node in the system. flexibility is main character energy, no cap πŸ”₯


⭐ RETURN ⭐

  • the physical address of the allocated memory block on success πŸ’–
  • 0 on failure 😭 (and we do NOT talk about it)

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./mm/memblock.c, plus memblock overview(9) and honestly the entire memblock friend group, fr fr:

no gatekeeping here β€” read the whole squad, iykyk 🌈

🧚 the cute little sign-off 🫢

that's the whole page, bestie!! this one came from the source ./mm, dated October 2026, and it's filed under the Kernel API Manual as memblock_phys_alloc_try_nid(9). slay, go allocate something iconic πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from