Skip to content

Commit 976e0e3

Browse files
YuryNorovKAGA-KOKO
authored andcommitted
smp: Use cpumask_any_but() in smp_call_function_many_cond()
smp_call_function_many_cond() opencodes cpumask_any_but(). Signed-off-by: Yury Norov [NVIDIA] <yury.norov@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/20250623000010.10124-3-yury.norov@gmail.com
1 parent 5f29551 commit 976e0e3

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

kernel/smp.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -807,13 +807,8 @@ static void smp_call_function_many_cond(const struct cpumask *mask,
807807
run_local = true;
808808

809809
/* Check if we need remote execution, i.e., any CPU excluding this one. */
810-
cpu = cpumask_first_and(mask, cpu_online_mask);
811-
if (cpu == this_cpu)
812-
cpu = cpumask_next_and(cpu, mask, cpu_online_mask);
813-
if (cpu < nr_cpu_ids)
810+
if (cpumask_any_and_but(mask, cpu_online_mask, this_cpu) < nr_cpu_ids) {
814811
run_remote = true;
815-
816-
if (run_remote) {
817812
cfd = this_cpu_ptr(&cfd_data);
818813
cpumask_and(cfd->cpumask, mask, cpu_online_mask);
819814
__cpumask_clear_cpu(this_cpu, cfd->cpumask);

0 commit comments

Comments
 (0)