lkml.org 
[lkml]   [2023]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v4 2/4] arch_topology: Support SMT control for OF based system
Date
From: Yicong Yang <yangyicong@hisilicon.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@hisilicon.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 3ed6bdf9460e..252a436e0c1b 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -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) {
--
2.24.0
\
 
 \ /
  Last update: 2023-11-21 10:30    [W:1.083 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site