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: <20231114040110.54590-3-yangyicong@huawei.com>
Date:   Tue, 14 Nov 2023 12:01:08 +0800
From:   Yicong Yang <yangyicong@...wei.com>
To:     <catalin.marinas@....com>, <will@...nel.org>,
        <sudeep.holla@....com>, <linux-arm-kernel@...ts.infradead.org>
CC:     <dietmar.eggemann@....com>, <gregkh@...uxfoundation.org>,
        <rafael@...nel.org>, <jonathan.cameron@...wei.com>,
        <prime.zeng@...ilicon.com>, <linuxarm@...wei.com>,
        <yangyicong@...ilicon.com>, <linux-kernel@...r.kernel.org>
Subject: [PATCH v3 2/4] arch_topology: Support SMT control for OF based system

From: Yicong Yang <yangyicong@...ilicon.com>

On building the topology from the devicetree, we've already
gotten the SMT thread number of each core. Update the largest
SMT thread number to enable the SMT control.

Signed-off-by: Yicong Yang <yangyicong@...ilicon.com>
---
 drivers/base/arch_topology.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index 7fb91f41d66d..02dc0266cbac 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -529,6 +529,13 @@ static int __init parse_core(struct device_node *core, int package_id,
 		i++;
 	} while (t);
 
+	/*
+	 * We've already gotten threads number in this core, update the SMT
+	 * threads number when necessary.
+	 */
+	if (i > topology_smt_num_threads)
+		topology_smt_set_num_threads(i);
+
 	cpu = get_cpu_for_node(core);
 	if (cpu >= 0) {
 		if (!leaf) {
-- 
2.24.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ