]> git.ipfire.org Git - thirdparty/linux.git/commit
cpumask: add cpumask_clear_cpus()
authorYury Norov [NVIDIA] <yury.norov@gmail.com>
Wed, 4 Jun 2025 19:39:37 +0000 (15:39 -0400)
committerLeon Romanovsky <leon@kernel.org>
Thu, 26 Jun 2025 09:19:15 +0000 (05:19 -0400)
commit16e2707cf15e09234445d40ddd76f11240be8767
treefa518e34268b62d59125ddaa2d304ac76bccd7ba
parent43163f4c30f94d2103c948a247cdf2cda5068ca7
cpumask: add cpumask_clear_cpus()

When user wants to clear a range in cpumask, the only option the API
provides now is a for-loop, like:

for_each_cpu_from(cpu, mask) {
if (cpu >= ncpus)
break;
__cpumask_clear_cpu(cpu, mask);
}

In the bitmap API we have bitmap_clear() for that, which is
significantly faster than a for-loop. Propagate it to cpumasks.

Signed-off-by: Yury Norov [NVIDIA] <yury.norov@gmail.com>
Link: https://patch.msgid.link/20250604193947.11834-2-yury.norov@gmail.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
include/linux/cpumask.h