From nobody Wed Oct 8 14:20:31 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C427F2571DD; Thu, 26 Jun 2025 21:55:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750974948; cv=none; b=J6zZ6GjK3JPvx/OydakKuvr613NFOe4dg/fk8gHv/3Wg2gqNtNk6zKdZZAkdfFTQIW0qXPxwVyFeZiLz5MXyWwk00cLGmSKKCRXrlrEt6JpS6nkRnC87+4FOWCLyauDmy2vsdh77bhc6wnwEKJ313E9Lf+j0qhaOETM2bZx1PlA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750974948; c=relaxed/simple; bh=zL0wTsG8zuIic6fxR+GDXbV5z9jugmrFBBu9SjMRyXY=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=G5pf/e49BnY074YEt6KRlbzwRx9hkYS6+wV3FUiAtW+hkm+zgBs8FKvTVpe948+T3zexZeuy3URbyYxkRMrbZXZvLBgI69S+a9wq3yP8R9H+iUUqXGviG/FL5KOiE2FeFBYqLwuT4K4EJz/LvcwWWqslQ4cb7yTuSvKKTga8H90= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=nJ2EDNSX; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=02u6G7gz; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="nJ2EDNSX"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="02u6G7gz" Date: Thu, 26 Jun 2025 21:55:44 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1750974945; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pAVKuE+09Dk48VIHkVepLhQ3rOYCBRRRZbKi53IbD/s=; b=nJ2EDNSXuCfPz+J5o4eWHyQrZQnkkrrs+I+HXxrYt8I7GheuqM/qSlGBwYokZSlL2kuzg4 1yGfk95XvqGX8378PWQOaz0twJPhvO+He/aiup5IytEB8gghG+Q+CGkV6qUFmTSFqZTNtZ sflMjwZbHz6RIx9o4JfizF+/+88URowikC3WYXTrnpgRFi8LMBtdr/O6NC0W+7aMM1cL9P PEvGCSTJPth4iRSdgofw1iZJJm1ElU0BkLe2qtddj+RJtKBKjrC8Qp2az6WeJZ5nC2MbnQ usfoEvkYQE+JM4+E9/ggD2e4Dqjwqb3qztb4yghV8rWwruvNL+yOw9mQsrWvpg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1750974945; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pAVKuE+09Dk48VIHkVepLhQ3rOYCBRRRZbKi53IbD/s=; b=02u6G7gzLW71d76cLE0tJAvoWcCh9faycDuntfR3DGPapdCLiv6Ru2qWo5QTNEb4EbO4de 14tz1MUWmAzEtICw== From: "tip-bot2 for Yury Norov [NVIDIA]" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: smp/core] smp: Use cpumask_any_but() in smp_call_function_many_cond() Cc: "Yury Norov [NVIDIA]" , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20250623000010.10124-3-yury.norov@gmail.com> References: <20250623000010.10124-3-yury.norov@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <175097494407.406.3604280257171753188.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the smp/core branch of tip: Commit-ID: 976e0e3103e463725e19a5493d02ce7b7b380663 Gitweb: https://git.kernel.org/tip/976e0e3103e463725e19a5493d02ce7b7= b380663 Author: Yury Norov [NVIDIA] AuthorDate: Sun, 22 Jun 2025 20:00:07 -04:00 Committer: Thomas Gleixner 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] Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/20250623000010.10124-3-yury.norov@gmail.c= om --- 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 c= pumask *mask, run_local =3D true; =20 /* Check if we need remote execution, i.e., any CPU excluding this one. */ - cpu =3D cpumask_first_and(mask, cpu_online_mask); - if (cpu =3D=3D this_cpu) - cpu =3D 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 =3D true; - - if (run_remote) { cfd =3D this_cpu_ptr(&cfd_data); cpumask_and(cfd->cpumask, mask, cpu_online_mask); __cpumask_clear_cpu(this_cpu, cfd->cpumask);