cpumask_weight_and(9)
π cpumask_weight_and β the Kernel API Manual, but make it group chat
okay so bestie, you're in the cpumask_weight_and(9) page of the Kernel API Manual and honestly? it's a little icon. short, sweet, does exactly one job. let's get into it β¨
πΈ NAME πΈ
cpumask_weight_and β it gives you the count of bits in (*srcp1 & *srcp2). that's it. that's the whole vibe. it ANDs two cpumasks together and then tells you how many bits survived the mashup π
π SYNOPSIS π
unsigned int cpumask_weight_and (const struct cpumask *srcp1 , const
struct cpumask *srcp2 );
two const pointers in, one unsigned int out. no cap, that's the whole signature π«Ά
π¦ ARGUMENTS π¦
srcp1β the cpumask to count bits (< nr_cpu_ids) in. yes queen, same energy as the next one πsrcp2β the cpumask to count bits (< nr_cpu_ids) in. that's it, that's the parameter π
both of them are just cpumasks whose bits are under nr_cpu_ids β nothing spicy, nothing sneaky, we love a low-drama argument list π
β RETURN β
the count of bits set in both *srcp1 and *srcp2. both. like, it's giving "we're only counting the bits that showed up to the group hang" π the overlap, the shared plans, the bits that said yes to both invites π₯°
π₯ SEE ALSO π₯
bestie, buckle up, because the Kernel file ./include/linux/cpumask.h is a whole friend group and this page is listing everyone β not me dropping a single name, we're doing the full roster π
- the first-and-last crew:
cpumask_pr_args(9),cpumask_first(9),cpumask_first_zero(9),cpumask_first_and(9),cpumask_first_andnot(9),cpumask_first_and_and(9),cpumask_last(9) - the next crew:
cpumask_next(9),cpumask_next_zero(9),cpumask_next_and(9),cpumask_next_andnot(9),cpumask_next_and_wrap(9),cpumask_next_wrap(9),cpumask_random(9) - the for_each loopers:
for_each_cpu(9),for_each_cpu_wrap(9),for_each_cpu_and(9),for_each_cpu_andnot(9),for_each_cpu_or(9),for_each_cpu_from(9) - the any-but crew:
cpumask_any_but(9),cpumask_any_and_but(9),cpumask_any_andnot_but(9) - the nth crew:
cpumask_nth(9),cpumask_nth_and(9),cpumask_nth_and_andnot(9) - the setters & testers:
cpumask_set_cpu(9),cpumask_clear_cpus(9),cpumask_clear_cpu(9),cpumask_test_cpu(9),cpumask_test_and_set_cpu(9),cpumask_test_and_clear_cpu(9),cpumask_setall(9),cpumask_clear(9) - the bitwise besties:
cpumask_and(9),cpumask_or(9),cpumask_weighted_or(9),cpumask_xor(9),cpumask_andnot(9) - the comparison girlies:
cpumask_equal(9),cpumask_or_equal(9),cpumask_intersects(9),cpumask_subset(9),cpumask_empty(9),cpumask_full(9) - the weight family (our relatives!!):
cpumask_weight(9),cpumask_weight_andnot(9) - the shifters & copiers:
cpumask_shift_right(9),cpumask_shift_left(9),cpumask_copy(9) - the any/any_and/of trio:
cpumask_any(9),cpumask_any_and(9),cpumask_of(9) - the parsers:
cpumask_parse_user(9),cpumask_parselist_user(9),cpumask_parse(9),cpulist_parse(9) - the size & alloc squad:
cpumask_size(9),alloc_cpumask_var(9),to_cpumask(9),num_online_cpus(9) - the printing duo:
cpumap_print_bitmask_to_buf(9),cpumap_print_list_to_buf(9)
likeβ¦ the way this page knows literally everyone? main character energy for a function that just counts bits ππ
anyway, that's the whole page bestie, no filler, no fluff, just bits being counted in the overlap π
okay bye ily, this was cpumask_weight_and(9) from ./include/linux, dated October 2026 β see you in the next man page, mwah ππ§β¨
π¦ 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