bpf_cpumask_and(9)
π bpf_cpumask_and(9) β the Kernel API Manual page you didn't know you needed π
okay so bestie, welcome to the bpf_cpumask_and page from the Kernel API Manual β yes, that one, the little corner of the kernel docs that is lowkey iconic. sit down, hydrate, and let's get into it πΈ
β¨ NAME β¨
bpf_cpumask_and β it ANDs two cpumasks together and stores the result. that's it. that's the whole vibe π
π¦ SYNOPSIS π¦
__bpf_kfunc bool bpf_cpumask_and (struct bpf_cpumask *dst , const struct cpumask *src1 , const struct cpumask *src2 );
literally just three args and a bool coming back at you, no cap β¨
π ARGUMENTS π
dstβ the BPF cpumask where the result is going to live. this is the main character of the operation, the one that gets changed πsrc1β the first input. one half of the AND πsrc2β the second input. the other half. together they slay π«Ά
β RETURN β
trueβdsthas at least one bit set following the operation. so it's not empty, we love that for us πfalseβdstis empty following the operation. bestie it's giving nothing in there ππ
π₯ DESCRIPTION π₯
so here's the tea: struct bpf_cpumask pointers are totally allowed to be safely passed into src1 and src2. like, it's fine. the kernel said so. no stress, no sneaky gotchas, just safe vibes π
β¨
πΈ SEE ALSO πΈ
go check out the kernel file ./kernel/bpf/cpumask.c and honestly just read the whole cpumask friend group, they're all here:
struct bpf_cpumask(9)bpf_cpumask_create(9)bpf_cpumask_acquire(9)bpf_cpumask_release(9)bpf_cpumask_first(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_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)
okay that's the page!! this little baddie lives in ./kernel/bpf and it's dated October 2026 β write it down, cite it in your essay, frame it, whatever π§π bye bestie, go AND some cpumasks responsibly πβ¨
π¦ 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