cpumask_first_andnot(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cpumask_first_andnot β€” bestie's guide to cpumask_first_andnot(9)

okay so first things first, the manual name is cpumask_first_andnot and this whole thing lives in the Kernel API Manual, section 9. buckle up πŸŽ€


✨ NAME ✨

cpumask_first_andnot β€” returns the very first cpu from *srcp1 & ~*srcp2, no cap πŸ’…

like, it's giving "who's in the first mask but NOT in the second mask, and who's first in line" energy. iconic.


🌸 SYNOPSIS 🌸

unsigned int cpumask_first_andnot (const struct cpumask *srcp1 , const
       struct cpumask *srcp2 );

that's the whole signature, take it in, it's literally right there 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • srcp1 β€” the first input. the main character mask, if you will πŸ‘‘
  • srcp2 β€” the second input. the other one we're subtracting from the vibe πŸ’€

⭐ RETURN ⭐

>= nr_cpu_ids if no such cpu found. πŸ‘€

so like, if it comes back with a number that's >= nr_cpu_ids, that's your sign that nothing matched β€” it's not a real cpu id, it's the "nope, didn't find one" of it all 😭


🌈 SEE ALSO 🌈

everything's in the kernel file ./include/linux/cpumask.h β€” and honestly the friend group here is HUGE, so let's go 🧚


fr fr that's a lot of friends. read them, love them, they're all in ./include/linux/cpumask.h πŸ’–

and that's the page!! mwah 🫢 this cutie is from ./include/linux, dated October 2026 β€” so note the date, bestie, and slay your kernel dev era β­πŸŒΈπŸ’œ

πŸ“¦ where this page comes from