cpumask_next_andnot(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cpumask_next_andnot β€” the Kernel API Manual tea 🫢

okay so bestie, welcome to cpumask_next_andnot(9), straight out of the Kernel API Manual ✨ this one's a lil cpu-hunting gremlin and honestly it ate.


✨ NAME ✨

cpumask_next_andnot β€” get the next cpu in *src1p & ~*src2p πŸ’–

Like... literally that's the whole personality. Next cpu that's in the first mask but not in the second. Periodt. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

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

three arguments, one little unsigned int coming back at ya, no cap 🌸


πŸ¦‹ ARGUMENTS πŸ¦‹

  • n β€” the cpu prior to the place to search, i.e. the return will be > n 🫢 so it's like "start me after this one bestie"
  • src1p β€” the first cpumask pointer πŸ’… the "yes please" mask
  • src2p β€” the second cpumask pointer 🌸 the "no thank u" mask

⭐ RETURN ⭐

>= nr_cpu_ids if no further cpus set in both. 😭 that's the "she's not here, go home" signal β€” if you get something at or past nr_cpu_ids, the search found nothing. not me refreshing the group chat for a cpu that doesn't exist πŸ’€

no cap, >= nr_cpu_ids is the empty-result vibe check. if your number lands there, nothing matched *src1p & ~*src2p past n.

🌈 SEE ALSO 🌈

the whole friend group fr fr β€” Kernel file ./include/linux/cpumask.h and:

iykyk, that's the entire cpumask extended universe πŸ’œ


lowkey reminder: this page lives under ./include/linux in the kernel tree, and that cpumask_next_andnot is a select-flavored "give me a cpu that's in the first mask but not the second" situation. every single sibling above is listed exactly as-is, so go click around the family tree 🌸

and that's the page!! 🧚 sign-off time: this cutie ships from the source/version line ./include/linux, dated October 2026, and yes she's iconic for it πŸ’…βœ¨ πŸŽ€

πŸ“¦ where this page comes from