bpf_cpumask_first_zero(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… bpf_cpumask_first_zero β€” from the Kernel API Manual, bestie πŸŽ€

Okay so picture this: it's a man page, manual name is Kernel API Manual, the function is bpf_cpumask_first_zero, and I'm about to make it make sense for you. Buckle up. ✨

🌸 NAME 🌸

bpf_cpumask_first_zero β€” literally just gets you the index of the first unset bit in the cpumask. That's it. That's the whole gig. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

__bpf_kfunc u32 bpf_cpumask_first_zero (const struct cpumask *cpumask );

πŸ“ ARGUMENTS πŸ“

  • cpumask β€” the cpumask we're querying. The one being snooped on. The main character of this little operation. πŸ‘‘

✨ DESCRIPTION ✨

So what we're doing here is finding the index of the first unset bit of the cpumask. Like, the first zero, the first empty slot, the first "nobody's home" bit. πŸ”

And here's the cute part: a struct bpf_cpumask pointer may be safely passed to this function. No cap. You can just hand it over and it's fine. 🫢

πŸ”₯ RETURN πŸ”₯

  • The index of the first zero bit in the struct cpumask. That's your answer, bestie, that's the whole return value. πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./kernel/bpf/cpumask.c β€” and honestly obsessed with this whole squad, they're all in struct bpf_cpumask(9) together:


fr fr, that's every single one of them, no skipping, we don't do that here πŸ’…

Okay that's the whole page! Big slay, love that for us. Signing off from ./kernel/bpf, dated October 2026, page bpf_cpumask_first_zero(9) β€” stay zero-bit-hunting, bestie πŸ§šπŸ’œ

πŸ“¦ where this page comes from