cpumask_next_andnot(9)
π cpumask_next_andnot β the Kernel API Manual tea π«Ά
okay so bestie, welcome to cpumask_next_andnot(9), straight out of the Kernel API Manual β¨ this one's a lil cpu-hunting gremlin and honestly it ate.
β¨ NAME β¨
cpumask_next_andnot β get the next cpu in *src1p & ~*src2p π
Like... literally that's the whole personality. Next cpu that's in the first mask but not in the second. Periodt. π
π SYNOPSIS π
unsigned int cpumask_next_andnot (int n , const struct cpumask *src1p ,
const struct cpumask *src2p );
three arguments, one little unsigned int coming back at ya, no cap πΈ
π¦ ARGUMENTS π¦
nβ the cpu prior to the place to search, i.e. the return will be>nπ«Ά so it's like "start me after this one bestie"src1pβ the first cpumask pointer π the "yes please" masksrc2pβ the second cpumask pointer πΈ the "no thank u" mask
β RETURN β
>= nr_cpu_ids if no further cpus set in both. π that's the "she's not here, go home" signal β if you get something at or past nr_cpu_ids, the search found nothing. not me refreshing the group chat for a cpu that doesn't exist π
no cap,>= nr_cpu_idsis the empty-result vibe check. if your number lands there, nothing matched*src1p & ~*src2ppastn.
π SEE ALSO π
the whole friend group fr fr β Kernel file ./include/linux/cpumask.h and:
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)cpumask_next(9),cpumask_next_zero(9),cpumask_next_and(9),cpumask_next_and_wrap(9),cpumask_next_wrap(9),cpumask_random(9)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)cpumask_any_but(9),cpumask_any_and_but(9),cpumask_any_andnot_but(9)cpumask_nth(9),cpumask_nth_and(9),cpumask_nth_and_andnot(9)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)cpumask_and(9),cpumask_or(9),cpumask_weighted_or(9),cpumask_xor(9),cpumask_andnot(9),cpumask_equal(9),cpumask_or_equal(9),cpumask_intersects(9),cpumask_subset(9),cpumask_empty(9),cpumask_full(9)cpumask_weight(9),cpumask_weight_and(9),cpumask_weight_andnot(9)cpumask_shift_right(9),cpumask_shift_left(9),cpumask_copy(9)cpumask_any(9),cpumask_any_and(9),cpumask_of(9)cpumask_parse_user(9),cpumask_parselist_user(9),cpumask_parse(9),cpulist_parse(9),cpumask_size(9)alloc_cpumask_var(9),to_cpumask(9),num_online_cpus(9)cpumap_print_bitmask_to_buf(9),cpumap_print_list_to_buf(9)
iykyk, that's the entire cpumask extended universe π
lowkey reminder: this page lives under./include/linuxin the kernel tree, and thatcpumask_next_andnotis aselect-flavored "give me a cpu that's in the first mask but not the second" situation. every single sibling above is listed exactly as-is, so go click around the family tree πΈ
and that's the page!! π§ sign-off time: this cutie ships from the source/version line ./include/linux, dated October 2026, and yes she's iconic for it π
β¨ π
π¦ 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