bpf_cpumask_populate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the struct 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 a long and 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:


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