cpumask_weighted_or(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cpumask_weighted_or(9) β€” from the Kernel API Manual, bestie

Okay so picture this: you're deep in ./include/linux, vibing with your cpumasks, and you need to OR two of them together and know how many bits ended up set. That's this function. It's giving "two birds, one stone" energy. πŸͺ„βœ¨


✨ NAME ✨

cpumask_weighted_or β€” literally does *dstp = *src1p | *src2p and then hands you back the weight of the result. Yes bestie, it does the OR and counts the bits. Multitasking icon. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

unsigned int cpumask_weighted_or (struct cpumask *dstp , const struct cpumask *src1p , const struct cpumask *src2p );

Three struct cpumask * pointers walk into a function. No cap, that's the whole signature. 🫢


🌸 ARGUMENTS 🌸

  • dstp β€” the cpumask result. This is where the magic lands, so it's giving main character energy. Where your OR'd answer gets written. πŸ’–
  • src1p β€” the first input. Input number one, doing its part. 🌼
  • src2p β€” the second input. Input number two, equally valid, equally needed. 🌷

⭐ RETURN ⭐

The number of bits set in the resulting cpumask dstp. So like, you get the count directly β€” no extra cpumask_weight(9) call needed. Efficient queen behavior. πŸ”₯

Ngl, the return value is the weight of dstp, i.e. the result β€” not the inputs. Read it twice if you must, bestie, I believe in you. πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

Everything else living in the kernel file ./include/linux/cpumask.h β€” the whole friend group, fr fr:

Like I said. The whole squad. Go say hi. πŸ‘‹πŸ’œ


That's the whole page, bestie β€” no crumbs left behind. πŸ’…

Sign-off time: this little masterpiece lives at ./include/linux and it's stamped October 2026, so go forth and OR your cpumasks with confidence. πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from