bpf_cpumask_first(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… bpf_cpumask_first(9)

okay bestie, welcome to the bpf_cpumask_first page β€” it's a Kernel API Manual situation, and honestly? iconic. You want the first nonzero bit of a cpumask? Then you're in the right place, no cap. πŸŽ€


✨ NAME ✨

bpf_cpumask_first β€” get the index of the first nonzero bit in the cpumask. That's it. That's the whole vibe. πŸ’–


🌸 SYNOPSIS 🌸

__bpf_kfunc u32 bpf_cpumask_first (const struct cpumask *cpumask );

literally just hand it a cpumask and it hands you back a u32. slay. ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • cpumask β€” the cpumask you're querying, bestie. the one you're asking about. the main character of this function call. πŸ’…

πŸ’œ DESCRIPTION πŸ’œ

So the whole job here is simple: find the index of the first nonzero bit of the cpumask. That's the assignment. That's what we're doing. πŸ”₯

And here's the cute part β€” a struct bpf_cpumask pointer may be safely passed to this function. Yes, safely. So like, go off. 🫢


πŸ‘‘ RETURN πŸ‘‘

  • the index of the first nonzero bit in the struct cpumask. πŸŽ€ that's your answer, that's your prize, enjoy.

🌈 SEE ALSO 🌈

Kernel file ./kernel/bpf/cpumask.c β€” and also the whole friend group:

all of them. every single one. tag yourself, i'm bpf_cpumask_first_zero. πŸ™ˆ


anyway that's the page!! this little gem lives under ./kernel/bpf and the version stamp is October 2026 β€” go forth and find your first nonzero bit, bestie, i believe in you πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from