find_next_best_node(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 β€” a nodemask_t of 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:

no cap, that's a whole group chat πŸ’…


ngl this page lives in ./mm, dated October 2026, and it's literally find_next_best_node(9) β€” that's the whole sign-off bestie, mwah πŸŽ€πŸ’–
πŸ“¦ where this page comes from