get_pfn_range_for_nid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… get_pfn_range_for_nid(9) β€” Kernel API Manual πŸŽ€

okay bestie, welcome to the Kernel API Manual, and today's main character is get_pfn_range_for_nid β€” the little function that tells you where a node's memory actually lives. no cap, it's giving "where's the party and where does it end" energy ✨


🌸 NAME 🌸

get_pfn_range_for_nid β€” returns the start and end page frames for a node πŸ’–


✨ SYNOPSIS ✨

void get_pfn_range_for_nid (unsigned int nid , unsigned long *start_pfn
, unsigned long *end_pfn );

like, that's the whole signature, and yes, she takes pointers β€” we love a function that writes back to you 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • nid β€” the node id you want the range for, periodt. and here's the plot twist: if it's MAX_NUMNODES, you get the min and max PFN back instead. iykyk 😌
  • start_pfn β€” passed by reference, bestie. on return it'll be holding the node start_pfn. she doesn't come empty, she comes filled in πŸ’…
  • end_pfn β€” same deal, also passed by reference. on return it'll have the node end_pfn. twin behavior, honestly iconic πŸŽ€

πŸ”₯ DESCRIPTION πŸ”₯

so what does she actually do? she returns the start and end page frame of a node, based on the info that memblock_set_node handed over. that's the source of truth, no guessing 🌟

⚠️ but listen β€” if you call her for a node with no available memory, the start and end PFNs will both be 0. that's not a bug, that's just the vibe check coming back empty. don't @ me 😭


πŸ’œ SEE ALSO πŸ’œ

go read those if you're nosy, which β€” same 🧚


and that's the whole page, bestie πŸ“ straight from ./mm, October 2026 edition β€” get_pfn_range_for_nid(9), slaying in a kernel near you πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from