nearest_node_nodemask(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… nearest_node_nodemask β€” Kernel API Manual, bestie edition πŸ’…

okay so this is nearest_node_nodemask(9) from the Kernel API Manual and honestly? she's a little icon. let's get into it 🫢


✨ NAME ✨

nearest_node_nodemask β€” finds the node in @mask that's at the nearest distance from @node. that's it. that's the whole job. and she does it slayfully πŸ’–


🌸 SYNOPSIS 🌸

int nearest_node_nodemask (int node , nodemask_t *mask );

look at her. tiny. perfect. no cap. πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • node β€” a valid node ID, the place you're starting your little search from. this is your main character. your origin point. ✨
  • mask β€” a pointer to a nodemask representing all the allowed nodes. like the guest list at the function, except the function is a NUMA topology 🌈

πŸ’œ DESCRIPTION πŸ’œ

so what she does is literally this: she iterates over all the nodes in mask, calculates the distance from the starting node for each one, and then returns the node ID that is the closest to node. lowkey a queen for that πŸ‘‘

and if no node is found? she returns MAX_NUMNODES. respect the fallback. periodt. πŸ’…

⚠️ okay bestie listen to me on this one ⚠️ β€” node must be a valid node ID usable with node_distance. if you hand her an invalid node ID (like NUMA_NO_NODE for example), you may end up with crashes or unexpected behavior. and not the cute kind of unexpected. the 😭 kind. please do a vibe check on your arguments before calling. fr fr.

πŸ”₯ SEE ALSO πŸ”₯

go read them. iykyk. πŸ“šπŸ’«


🌸 that's the whole page, diva 🌸 she lives in ./mm, dated October 2026, and she's filed under the name nearest_node_nodemask(9). go off, nearest-node queen. πŸ‘‘πŸŽ€πŸ’–

πŸ“¦ where this page comes from