sched_numa_find_nth_cpu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… sched_numa_find_nth_cpu(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so picture this: you're in the Kernel API Manual, you open up sched_numa_find_nth_cpu(9), and it's literally the function that answers "hey, out of these CPUs, which one is the Nth closest to this CPU, when you factor in how far away a given NUMA node is?" Like it's giving matchmaker energy but for silicon. πŸ¦‹


✨ NAME ✨

sched_numa_find_nth_cpu β€” given the NUMA topology, find the Nth closest CPU from @cpus to @cpu, taking into account distance from a given @node. No cap, that's the whole vibe. 🌸


✨ SYNOPSIS ✨

int sched_numa_find_nth_cpu (const struct cpumask *cpus , int cpu , int node );

✨ ARGUMENTS ✨

  • cpus β€” the cpumask you wanna find a cpu from πŸ’– (your candidate pool, basically the group chat you're picking from)
  • cpu β€” the CPU you start searching from πŸ‘‘ (your main character starting point)
  • node β€” the NUMA node you order CPUs by distance against 🧚 (the vibe check ruler)

✨ RETURN ✨

Returns cpu, or nr_cpu_ids when nothing found. 😭 Like if the search comes up empty, that's your "no thoughts, head empty" signal β€” periodt.


✨ SEE ALSO ✨


ok bestie that's the whole page, go forth and be iconic with your CPU selection 🫢

signing off from the Kernel API Manual β€” source path ./kernel/sched, dated October 2026, and yes this was sched_numa_find_nth_cpu(9) the entire time πŸ’œ

πŸ“¦ where this page comes from