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: <20220510154750.212913-15-yury.norov@gmail.com>
Date:   Tue, 10 May 2022 08:47:42 -0700
From:   Yury Norov <yury.norov@...il.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        David Laight <David.Laight@...LAB.COM>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Joe Perches <joe@...ches.com>,
        Julia Lawall <Julia.Lawall@...ia.fr>,
        Michał Mirosław <mirq-linux@...e.qmqm.pl>,
        Nicholas Piggin <npiggin@...il.com>,
        Nicolas Palix <nicolas.palix@...g.fr>,
        Peter Zijlstra <peterz@...radead.org>,
        Rasmus Villemoes <linux@...musvillemoes.dk>,
        Matti Vaittinen <Matti.Vaittinen@...rohmeurope.com>,
        linux-kernel@...r.kernel.org
Cc:     Yury Norov <yury.norov@...il.com>,
        Balbir Singh <sblbir@...zon.com>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        "H . Peter Anvin" <hpa@...or.com>, Huang Rui <ray.huang@....com>,
        Ingo Molnar <mingo@...hat.com>,
        "Paul E . McKenney" <paulmck@...nel.org>,
        "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
        Sean Christopherson <seanjc@...gle.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Tim Chen <tim.c.chen@...ux.intel.com>, x86@...nel.org
Subject: [PATCH 14/22] x86: smp: use cpumask_weight_eq() in remove_siblinginfo

cpumask_weight_eq() is more efficient because it may stop traversing
cpumask depending on condition.

CC: Balbir Singh <sblbir@...zon.com>
CC: Boris Ostrovsky <boris.ostrovsky@...cle.com>
CC: Borislav Petkov <bp@...en8.de>
CC: Dave Hansen <dave.hansen@...ux.intel.com>
CC: H. Peter Anvin <hpa@...or.com>
CC: Huang Rui <ray.huang@....com>
CC: Ingo Molnar <mingo@...hat.com>
CC: Paul E. McKenney <paulmck@...nel.org>
CC: Peter Zijlstra <peterz@...radead.org>
CC: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
CC: Sean Christopherson <seanjc@...gle.com>
CC: Thomas Gleixner <tglx@...utronix.de>
CC: Tim Chen <tim.c.chen@...ux.intel.com>
CC: x86@...nel.org
CC: linux-kernel@...r.kernel.org
Signed-off-by: Yury Norov <yury.norov@...il.com>
---
 arch/x86/kernel/smpboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 7d948f79ef31..74ca98b3ab2a 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1621,7 +1621,7 @@ static void remove_siblinginfo(int cpu)
 
 	for_each_cpu(sibling, topology_sibling_cpumask(cpu)) {
 		cpumask_clear_cpu(cpu, topology_sibling_cpumask(sibling));
-		if (cpumask_weight(topology_sibling_cpumask(sibling)) == 1)
+		if (cpumask_weight_eq(topology_sibling_cpumask(sibling), 1))
 			cpu_data(sibling).smt_active = false;
 	}
 
-- 
2.32.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ