sched_numa_hop_mask(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… sched_numa_hop_mask(9) β€” a Kernel API Manual moment

okay bestie, welcome to the sched_numa_hop_mask(9) page, straight out of the Kernel API Manual ✨ this one's a little function with big "don't hold onto this pointer" energy, so stay with me 🫢


🌸 NAME

sched_numa_hop_mask β€” get the cpumask of CPUs at most @hops hops away from @node πŸ’–


✨ SYNOPSIS

const struct cpumask * sched_numa_hop_mask (unsigned int node , unsigned int hops );

like, that's the whole signature. short. iconic. no cap πŸ‘‘


πŸŽ€ ARGUMENTS

  • node β€” the node you're counting hops from. that's your starting point, your main character node 🌟
  • hops β€” include CPUs up to that many hops away. and 0 means local node, i.e. the node itself, zero travelling required 🏠

πŸ¦‹ RETURN

On success you get a pointer to a cpumask of CPUs at most hops away from node. on failure? you get an error value instead 😭 so like, check it, bestie.


πŸ”₯ DESCRIPTION

Requires rcu_lock to be held. fr fr, this is not optional.

The returned cpumask is only valid within that read-side section β€” so if you need it beyond that, copy it. don't be out here holding a pointer to vibes that already expired πŸ’€

Also note that not all hops are equal in distance; see sched_init_numa for how distances and masks are handled πŸ‘€ (yes, a hop is not just a hop, it's giving "it's complicated" πŸ™ˆ).

And also note that this is a reflection of sched_domains_numa_masks, which may change during the lifetime of the system β€” offline nodes are taken out of the masks. so the mask can literally change under you. lowkey important. highkey important actually ⭐


🌈 SEE ALSO


that's the whole page, bestie, you ate that πŸ“βœ¨ sign-off time: this lil cutie lives in ./kernel/sched, dated October 2026, and it's still called sched_numa_hop_mask(9) πŸ’œπŸŽ€

πŸ“¦ where this page comes from