cpumask_test_cpu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cpumask_test_cpu β€” the Kernel API Manual moment we've all been waiting for

okay so bestie, listen. This is a page from the Kernel API Manual (yes, that one, the cpumask_test_cpu(9) page, main character energy fr) and it's honestly such a vibe check for one specific CPU. Let's get into it πŸŽ€


✨ NAME ✨

cpumask_test_cpu β€” literally just testing whether a cpu is in a cpumask. That's it. That's the whole job. And she does it flawlessly πŸ‘‘


🌸 SYNOPSIS 🌸

bool cpumask_test_cpu (int cpu , const struct cpumask *cpumask );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • cpu β€” the cpu number, and ngl there's a rule: it has to be < nr_cpu_ids. So like, valid cpu numbers only, no clownery πŸ™ˆ
  • cpumask β€” the cpumask pointer. Your mask. Your little roster. She needs the pointer, not the whole struct, we're being efficient here πŸ’…

πŸ’– RETURN πŸ’–

Returns true if cpu is set in cpumask, else returns false.

That's it. Binary. Iconic. No "maybe", no "it depends" β€” just true or false, periodt ⭐


🫢 SEE ALSO 🫢

Kernel file: ./include/linux/cpumask.h

okay this list is LONG but every single one of these is a sibling and they all deserve their moment, so here's the whole family:


ngl if you're only here for one bit of info: true = the cpu is in the mask, false = she's not. that's the tea β˜•

anyway bestie, this page came straight out of ./include/linux, dated October 2026, and it's filed under cpumask_test_cpu(9) β€” go forth and test those cpus πŸ’œβœ¨πŸŒΈ

πŸ“¦ where this page comes from