node_map_pfn_alignment(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« node_map_pfn_alignment β€” the kernel API manual, but make it cute πŸ’«

okay so bestie, we're in the Kernel API Manual and today's main character is node_map_pfn_alignment(9). yes she's got a long name. no she's not sorry. 🌸


πŸŽ€ NAME πŸŽ€

node_map_pfn_alignment β€” literally just here to determine the maximum internode alignment. that's it. that's her whole thing. slay. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

unsigned long node_map_pfn_alignment (void );

πŸ’… ARGUMENTS πŸ’…

  • void β€” no arguments. nothing. zero. she takes nothing and she gives you an unsigned long. iconic behavior tbh. πŸ™ˆ

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the vibe: this function should be called after the node map is populated and sorted. like, that's the prerequisite. don't come at her before that, she will not know what to do with you. 😭

what she does is calculate the maximum power of two alignment which can distinguish all the nodes. periodt. πŸ’œ

example time, because examples ate:

  • if all nodes are 1GiB and aligned to 1GiB, the return value would indicate 1GiB alignment with (1 << (30 - PAGE_SHIFT))
  • if the nodes are shifted by 256MiB, then it's 256MiB
  • note: if only the last node is shifted, 1GiB is enough and this function will indicate so πŸ‘‘

and what's all this for?? glad you asked bestie 🫢 β€” it's used to test whether the pfn -> nid mapping of the chosen memory model has fine enough granularity to avoid incorrect mapping for the populated node map. like a vibe check for your memory model, no cap.


⭐ RETURN ⭐

  • the determined alignment in pfn's.
  • 0 if there is no alignment requirement (single node). single node? no alignment drama? she returns 0 and moves on. 🧚

🌈 SEE ALSO 🌈


aaaand that's the whole page!! πŸ’– this one lives in ./mm, dated October 2026, and it's node_map_pfn_alignment(9) if you need to find her again β€” go read the rest of the kernel, bestie, you got this πŸ“πŸ’…

πŸ“¦ where this page comes from