bpf_cpumask_first_zero(9)
π 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:
bpf_cpumask_create(9)bpf_cpumask_acquire(9)bpf_cpumask_release(9)bpf_cpumask_first(9)bpf_cpumask_first_and(9)bpf_cpumask_set_cpu(9)bpf_cpumask_clear_cpu(9)bpf_cpumask_test_cpu(9)bpf_cpumask_test_and_set_cpu(9)bpf_cpumask_test_and_clear_cpu(9)bpf_cpumask_setall(9)bpf_cpumask_clear(9)bpf_cpumask_and(9)bpf_cpumask_or(9)bpf_cpumask_xor(9)bpf_cpumask_equal(9)bpf_cpumask_intersects(9)bpf_cpumask_subset(9)bpf_cpumask_empty(9)bpf_cpumask_full(9)bpf_cpumask_copy(9)bpf_cpumask_any_distribute(9)bpf_cpumask_any_and_distribute(9)bpf_cpumask_weight(9)bpf_cpumask_populate(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms