memblock_set_node(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 memblock_set_node(9) 🌸

okay bestie, welcome to the memblock_set_node page β€” it's from the Kernel API Manual, section 9, and it's honestly kind of a little legend. it's the function that goes "hey, this chunk of memory? it belongs to this NUMA node now πŸ’…" and just makes it happen. no cap.


✨ SYNOPSIS ✨

int __init_memblock memblock_set_node (phys_addr_t base , phys_addr_t size ,
                                       struct memblock_type *type , int nid );

like, look at that signature. it ate. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • base β€” the base of the area you're setting the node ID for. the starting point, the origin story, the "we begin here." πŸ“
  • size β€” the size of that area. how much memory we're talking about. the span, the range, the vibe check radius. πŸ“
  • type β€” which memblock type we're setting the node ID for. it's a struct memblock_type *, so yes bestie, pointer, don't forget the *. 🧚
  • nid β€” the actual node ID you want to set. the number. the whole point of the whole function. πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

so here's the tea: this bad boy sets the nid of memblock type regions inside [base, base + size) to nid. literally exactly that. that's the whole job and it does it slayfully.

and the iconic part? regions which cross the area boundaries are split as necessary. so if a region is like half in, half out of your range, it doesn't just give up β€” it splits it. main character energy fr fr. πŸ”₯


⭐ RETURN ⭐

  • 0 on success β€” we love a zero. we stan a zero. πŸŽ‰
  • -errno on failure β€” something went sideways and it's telling you why in errno form. 😭

πŸ¦‹ SEE ALSO πŸ¦‹

okay this list is LONG so buckle up, buttercup β€” every single one of these is here, no skipping, no cutting corners:

iykyk, that's the whole memblock friend group right there. 🌈


and that's the page, bestie! this one lives in the source tree at ./mm and the version stamp says October 2026 β€” so yeah, timestamped and everything. now go set some node IDs, you gorgeous kernel gremlin πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from