cpumask_any_and_distribute(9)
π cpumask_any_and_distribute(9) β¨
okay so bestie, welcome to the Kernel API Manual β pull up a chair, we're talking about cpumask_any_and_distribute, and honestly? she's giving "quiet utility, loud personality." π
β¨ SYNOPSIS β¨
unsigned int cpumask_any_and_distribute (const struct cpumask *src1p ,
const struct cpumask *src2p );
like, she takes two cpumasks and hands you back an unsigned int. that's it. that's the whole vibe. π¦
πΈ ARGUMENTS πΈ
src1pβ your first cpumask, here for the intersection moment πsrc2pβ your second cpumask, also here for the intersection moment π
(it takes two to tango, babes. both of them are "for intersection." no cap.)
π DESCRIPTION π
so here's the tea β β if you keep calling this thing over and over with the same srcp1 and srcp2, the calls get distributed within their intersection. like, it rotates through the overlap so everybody gets a turn. main character energy for your CPUs, fr fr. π
not me explaining set intersection like it's a group chat where only the people in both group chats get the invite π
β RETURN β
she returns >= nr_cpu_ids if the intersection is empty π β which is the kernel-y way of saying "girl, there was literally nobody in common, so here's a number that says so."
lowkey important: if the intersection's empty, that's what you get back. don't go treating it like a real CPU id, iykyk π«Ά
π¦ SEE ALSO π¦
all the siblings and cousins of this function, gathered for your reading pleasure β¨:
- Kernel file
./lib/cpumask.c alloc_cpumask_var_node(9)alloc_bootmem_cpumask_var(9)free_cpumask_var(9)free_bootmem_cpumask_var(9)cpumask_local_spread(9)cpumask_any_distribute(9)
and that's the whole page, bestie β no crumbs left behind, every flag and fact intact, we ate and left absolutely no notes π
signing off from ./lib, dated October 2026, in the one and only cpumask_any_and_distribute(9) era πβ¨π«Ά
π¦ 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