bpf_cpumask_test_cpu(9)
β¨ bpf_cpumask_test_cpu(9) β¨
okay so bestie, welcome to the Kernel API Manual π β today's main character is bpf_cpumask_test_cpu(9), and she's literally just here to answer one (1) question: is this CPU in this mask or not. no cap.
πΈ NAME πΈ
bpf_cpumask_test_cpu β test whether a CPU is set in a cpumask π
π¦ SYNOPSIS π¦
__bpf_kfunc bool bpf_cpumask_test_cpu (u32 cpu , const struct cpumask
*cpumask );
that's the whole vibe. two arguments, one bool, zero drama π
π ARGUMENTS π
cpuβ the CPU you're querying for. like, the one you're asking about. the subject of the investigation πcpumaskβ the cpumask you're querying for containing a CPU. she's the guest list, and you're checking ifcpumade the cut ποΈ
π₯ RETURN π₯
trueβcpuis set in thecpumask. she's on the list, she's invited, slay πfalseβcpuwas not set in thecpumask, orcpuis an invalid cpu π (yes, invalid cpu also gets afalse, no special treatment, no exceptions, periodt)
π SEE ALSO π
the whole friend group π«Ά β plus the kernel file itself, ./kernel/bpf/cpumask.c, and our queen struct bpf_cpumask(9):
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_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)
that's it, that's the whole page π go forth and test your CPUs, bestie β and remember, invalid cpu = false, so don't come for her when she's just being honest π
mwah π β signed off from ./kernel/bpf, dated October 2026, your girl bpf_cpumask_test_cpu(9) πβ¨
π¦ 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