bpf_cpumask_populate(9)
π bpf_cpumask_populate(9) β the kernel API manual page, bestie edition
okay so this is a page from the Kernel API Manual, section 9, and it's all about bpf_cpumask_populate(9). yes that's a mouthful, we're getting through it together π«Ά
β¨ NAME β¨
bpf_cpumask_populate β literally populates the CPU mask from the contents of a BPF memory region. that's the whole gig. no cap π
πΈ SYNOPSIS πΈ
__bpf_kfunc int bpf_cpumask_populate (struct bpf_cpumask *cpumask , void *src , size_t src__sz );
π¦ ARGUMENTS π¦
cpumaskβ the cpumask that's getting populated. it's the main character here, the one receiving the vibes πsrcβ the BPF memory holding the bit pattern. this is where the good stuff comes from β¨src__szβ length of the BPF memory region, in bytes. gotta know how much you're working with, obviously π
π RETURN π
like, what do you get back? a few possibilities, bestie:
0β thestruct bpf_cpumask *instance was populated successfully. slay, it worked π-EACCESβ the memory region is too small to populate the cpumask. not enough to work with, tragic π-EINVALβ the memory region is not aligned to the size of alongand the architecture does not support efficient unaligned accesses. so like... wrong alignment and your arch can't just shrug it off. rude π
ngl, if you're hitting -EINVAL it's giving alignment issues β check both things before you go blaming the kernel, ok? π
π₯ SEE ALSO π₯
the whole friend group, fr fr:
- Kernel file
./kernel/bpf/cpumask.c 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_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)
okay that's the whole thing, you ate that π
β¨ this came out of ./kernel/bpf and it's dated October 2026 β so like, future vibes only πβ bye bestie, go populate some masks π
π¦ 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