find_next_best_node(9)
β¨ find_next_best_node(9) β¨
okay so bestie, welcome to the Kernel API Manual β this one's a lil function from ./mm and honestly it's giving matchmaker energy for NUMA nodes π
πΈ NAME πΈ
find_next_best_node β find the next node that should appear in a given node's fallback list
π SYNOPSIS π
int find_next_best_node (int node , nodemask_t *used_node_mask );
π¦ ARGUMENTS π¦
nodeβ the node whose fallback list we're appending to. yeah. that one. it's her moment πused_node_maskβ anodemask_tof the nodes we've already used up. the "no repeats" list, basically. we don't recycle here π
π DESCRIPTION π
so we're picking the next node to go on node's fallback list, and like β it's not a vibe check, it's a criteria check. we use a number of factors to figure out which node is the next one that should appear π«Ά
here's the lineup of what matters:
- the node should not have already appeared in
node's fallback list (no double-dipping, we been knew π) - it should be the next closest node according to the distance array β which, btw, contains arbitrary distance values from each node to each node in the system β
- and it should also prefer nodes with no CPUs, since presumably they'll have very little allocation pressure on them otherwise. like, they're literally free. not a single CPU to stress them out. iconic π
π₯ RETURN π₯
the node id of the found node, or NUMA_NO_NODE if no node is found π
like bestie... sometimes there's just nobody. and that's the answer. NUMA_NO_NODE. periodt.
π SEE ALSO π
kernel file ./mm/page_alloc.c β and the whole friend group:
__get_pfnblock_flags_mask(9)get_pfnblock_bit(9)get_pfnblock_migratetype(9)__set_pfnblock_flags_mask(9)set_pfnblock_bit(9)clear_pfnblock_bit(9)set_pageblock_migratetype(9)__move_freepages_block_isolate(9)__putback_isolated_page(9)__free_pages(9)free_pages(9)alloc_pages_exact(9)alloc_pages_exact_nid(9)free_pages_exact(9)nr_free_zone_pages(9)nr_free_buffer_pages(9)free_reserved_pages(9)setup_per_zone_wmarks(9)__free_contig_range(9)alloc_contig_frozen_range(9)alloc_contig_range(9)alloc_contig_frozen_pages(9)alloc_contig_pages(9)free_contig_frozen_range(9)free_contig_range(9)alloc_pages_nolock(9)
no cap, that's a whole group chat π
ngl this page lives in./mm, dated October 2026, and it's literallyfind_next_best_node(9)β that's the whole sign-off bestie, mwah ππ
π¦ 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