bpf_cpumask_set_cpu(9)
π bpf_cpumask_set_cpu(9) β Kernel API Manual
okay so bestie, welcome to the glow-up era of bpf_cpumask_set_cpu π this is a page straight outta the Kernel API Manual, and it's literally about flipping one (1) single bit on for a CPU inside a BPF cpumask. that's it. that's the whole job. iconic, honestly π
β¨ NAME β¨
bpf_cpumask_set_cpu β set a bit for a CPU in a BPF cpumask π¦
like, you point at a CPU, you point at a cpumask, and boom β that CPU's bit is now on. no cap.
πΈ SYNOPSIS πΈ
__bpf_kfunc void bpf_cpumask_set_cpu (u32 cpu , struct bpf_cpumask
*cpumask );
she returns void, she's __bpf_kfunc, she takes exactly two things and she is NOT interested in anything else π
π ARGUMENTS π
cpuβ the CPU you want to be set in the cpumask. yes, that CPU. the one. the main character πcpumaskβ the BPF cpumask where the bit is actually getting set. this is the canvas, thecpuis the paint ποΈ
π₯ SEE ALSO π₯
okay this is the friend group, and they ALL show up, so let me introduce every single one, no skips, no cuts, 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_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)
like⦠the whole squad 𫢠go read them too, iykyk.
lowkey reminder: this page is just "set a bit." if you wanted "clear a bit," "test a bit," or "do both at once," that's a different friend up in SEE ALSO. don't come for me π
and that's the page!! sending you off with the vibe check: it's from ./kernel/bpf, dated October 2026, and it lives under the name bpf_cpumask_set_cpu(9) ππ slay, go set some bits, and remember β one CPU, one bit, one legend. periodt. β¨π§
π¦ 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