node_map_pfn_alignment(9)
π« 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 anunsigned 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
1GiBand aligned to1GiB, the return value would indicate1GiBalignment with(1 << (30 - PAGE_SHIFT)) - if the nodes are shifted by
256MiB, then it's256MiB - note: if only the last node is shifted,
1GiBis 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.
0if there is no alignment requirement (single node). single node? no alignment drama? she returns0and moves on. π§
π SEE ALSO π
- Kernel file
./mm/mm_init.c absent_pages_in_range(9)get_pfn_range_for_nid(9)free_area_init(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms