lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <175097494407.406.3604280257171753188.tip-bot2@tip-bot2>
Date: Thu, 26 Jun 2025 21:55:44 -0000
From: "tip-bot2 for Yury Norov [NVIDIA]" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: "Yury Norov [NVIDIA]" <yury.norov@...il.com>,
 Thomas Gleixner <tglx@...utronix.de>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Subject:
 [tip: smp/core] smp: Use cpumask_any_but() in smp_call_function_many_cond()

The following commit has been merged into the smp/core branch of tip:

Commit-ID:     976e0e3103e463725e19a5493d02ce7b7b380663
Gitweb:        https://git.kernel.org/tip/976e0e3103e463725e19a5493d02ce7b7b380663
Author:        Yury Norov [NVIDIA] <yury.norov@...il.com>
AuthorDate:    Sun, 22 Jun 2025 20:00:07 -04:00
Committer:     Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Thu, 26 Jun 2025 23:46:34 +02:00

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@...il.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Link: https://lore.kernel.org/all/20250623000010.10124-3-yury.norov@gmail.com

---
 kernel/smp.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/kernel/smp.c b/kernel/smp.c
index 7c8cfab..5871acf 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -807,13 +807,8 @@ static void smp_call_function_many_cond(const struct cpumask *mask,
 		run_local = true;
 
 	/* Check if we need remote execution, i.e., any CPU excluding this one. */
-	cpu = cpumask_first_and(mask, cpu_online_mask);
-	if (cpu == this_cpu)
-		cpu = cpumask_next_and(cpu, mask, cpu_online_mask);
-	if (cpu < nr_cpu_ids)
+	if (cpumask_any_and_but(mask, cpu_online_mask, this_cpu) < nr_cpu_ids) {
 		run_remote = true;
-
-	if (run_remote) {
 		cfd = this_cpu_ptr(&cfd_data);
 		cpumask_and(cfd->cpumask, mask, cpu_online_mask);
 		__cpumask_clear_cpu(this_cpu, cfd->cpumask);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ