bpf_cpumask_test_cpu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 if cpu made the cut 🎟️

πŸ”₯ RETURN πŸ”₯

  • true β€” cpu is set in the cpumask. she's on the list, she's invited, slay πŸ‘‘
  • false β€” cpu was not set in the cpumask, or cpu is an invalid cpu πŸ’€ (yes, invalid cpu also gets a false, 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):


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