cpumask_next_and_wrap(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cpumask_next_and_wrap(9)

okay so bestie, welcome to the Kernel API Manual ✨ β€” this one's a little function with main character energy: cpumask_next_and_wrap πŸŽ€

🌸 NAME 🌸

cpumask_next_and_wrap β€” grab the next cpu that's in src1p & src2p, starting from @n+1. And if there's nothing to find? it wraps around and starts from the beginning πŸ” literally the "no thoughts, head empty, loop back around" of cpu masks. periodt.


✨ SYNOPSIS ✨

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

πŸ¦‹ ARGUMENTS πŸ¦‹

  • n β€” the cpu prior to the place we're searching, i.e. the search kicks off from n+1 πŸ‘‘ (so it's the "one before", not the one you actually get, iykyk)
  • src1p β€” the first cpumask pointer πŸ’–
  • src2p β€” the second cpumask pointer πŸ’–

🫢 RETURN 🫢

the next set bit, wrapped if needed, or >= nr_cpu_ids if src1p & src2p is empty 😭 (big "we searched everywhere and found nobody" energy ngl).

🌈 SEE ALSO 🌈

Kernel file ./include/linux/cpumask.h β€” and honestly the whole cpumask friend group showed up to the group chat:


and that's the whole page, bestie!! this one lives in ./include/linux and it's dated October 2026 β€” so yeah, it's from the future, we love that for it πŸ’œπŸ¦‹ slay, go read the whole cpumask family, they ate fr fr πŸŽ€βœ¨

πŸ“¦ where this page comes from