sched_numa_find_nth_cpu(9)
π 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 β¨
- Kernel file
./kernel/sched/topology.c sched_numa_hop_mask(9)π₯
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
- 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