Commit 44a2386e authored by Yicong Yang's avatar Yicong Yang Committed by Jie Liu
Browse files

arch_topology: Support SMT control for OF based system

kunpeng inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8TAPW
CVE: NA

Reference: https://lore.kernel.org/all/20231121092602.47792-1-yangyicong@huawei.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: default avatarYicong Yang <yangyicong@hisilicon.com>
Signed-off-by: default avatarJie Liu <liujie375@h-partners.com>
parent 6dd0f06a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -526,6 +526,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_get_num_threads())
		topology_smt_set_num_threads(i);

	cpu = get_cpu_for_node(core);
	if (cpu >= 0) {
		if (!leaf) {