cpumask_any_and_distribute(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cpumask_any_and_distribute(9) ✨

okay so bestie, welcome to the Kernel API Manual β€” pull up a chair, we're talking about cpumask_any_and_distribute, and honestly? she's giving "quiet utility, loud personality." πŸŽ€


✨ SYNOPSIS ✨

unsigned int cpumask_any_and_distribute (const struct cpumask *src1p ,
   const struct cpumask *src2p );

like, she takes two cpumasks and hands you back an unsigned int. that's it. that's the whole vibe. πŸ¦‹


🌸 ARGUMENTS 🌸

  • src1p β€” your first cpumask, here for the intersection moment πŸ’–
  • src2p β€” your second cpumask, also here for the intersection moment πŸ’–

(it takes two to tango, babes. both of them are "for intersection." no cap.)


πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea β˜• β€” if you keep calling this thing over and over with the same srcp1 and srcp2, the calls get distributed within their intersection. like, it rotates through the overlap so everybody gets a turn. main character energy for your CPUs, fr fr. 🌈

not me explaining set intersection like it's a group chat where only the people in both group chats get the invite πŸ’€


⭐ RETURN ⭐

she returns >= nr_cpu_ids if the intersection is empty 😭 β€” which is the kernel-y way of saying "girl, there was literally nobody in common, so here's a number that says so."

lowkey important: if the intersection's empty, that's what you get back. don't go treating it like a real CPU id, iykyk 🫢

πŸ¦‹ SEE ALSO πŸ¦‹

all the siblings and cousins of this function, gathered for your reading pleasure ✨:


and that's the whole page, bestie β€” no crumbs left behind, every flag and fact intact, we ate and left absolutely no notes πŸ’…

signing off from ./lib, dated October 2026, in the one and only cpumask_any_and_distribute(9) era πŸŽ€βœ¨πŸ«Ά

πŸ“¦ where this page comes from