bpf_cpumask_first(9)
π 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:
struct bpf_cpumask(9)bpf_cpumask_create(9)bpf_cpumask_acquire(9)bpf_cpumask_release(9)bpf_cpumask_first_zero(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)
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
- 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