bpf_cpumask_acquire(9)
π bpf_cpumask_acquire(9) β from the Kernel API Manual, bestie π«Ά
okay so real talk, this one is short and sweet but it's IMPORTANT, so lock in for like thirty seconds β¨
β¨ NAME β¨
bpf_cpumask_acquire β grab yourself a reference to a BPF cpumask, no cap π
π SYNOPSIS π
__bpf_kfunc struct bpf_cpumask * bpf_cpumask_acquire (struct bpf_cpumask
*cpumask );
that's it. that's the whole vibe. one function, one argument, one pointer back π₯
πΈ ARGUMENTS πΈ
cpumaskβ the BPF cpumask you're acquiring, bestie. and listen: thecpumaskmust be a trusted pointer. that's not optional, that's the whole assignment. π
π¦ DESCRIPTION π¦
so what does it do? it acquires a reference to a BPF cpumask. literally that. π«Ά
but here's the part you cannot skip, and i mean it β the cpumask returned by this function must either:
- be embedded in a map as a
kptr, or - be freed with
bpf_cpumask_release
β οΈ like genuinely, pick one. those are the two options. don't just have a floating reference out there with no home, that's giving leak energy and we're not about that π
π RETURN π
- the
struct bpf_cpumaskpointer that was passed to the function. yes, the same one. it gives you back what you handed it. iconic behavior honestly π
β SEE ALSO β
go read these next, i'm obsessed with all of them, iykyk:
- Kernel file
./kernel/bpf/cpumask.c struct bpf_cpumask(9)bpf_cpumask_create(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_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)
and that's the page, bestie π this one came out of ./kernel/bpf, dated October 2026, and it's bpf_cpumask_acquire(9) in the Kernel API Manual β go forth and acquire your references responsibly, mwah π§
π¦ 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