[PATCH] arch_topology: Support SMT control on arm64

Dietmar Eggemann dietmar.eggemann at arm.com
Fri Sep 22 04:13:35 PDT 2023


On 21/09/2023 10:56, Yicong Yang wrote:
> On 2023/9/21 1:08, Dietmar Eggemann wrote:
>> On 19/09/2023 14:33, Yicong Yang wrote:
>>> From: Yicong Yang <yangyicong at hisilicon.com>

[...]

> If you manually disable SMT by offline each CPUs the cpu_smt_control will
> not be updated. It'll updated when using the interface like
> `/sys/devices/system/cpu/smt/control` or cmdline. By these means,
> the framework will use topology_is_primary_thread() to decide which CPU
> in the SMT will keep online:
> 
> // e.g. echo off > /sys/devices/system/cpu/smt/control
> [ kernel/cpu.c ]
> control_store()
>   __store_smt_control()
>     cpuhp_smt_disable()
>       for_each_online_cpu(cpu)
>         if (topology_is_primary_thread(cpu))
>           continue;            <---------- will skip the primary thread
>       [...]
>       cpu_smt_control = CPU_SMT_DISABLED;
> 
> topology_is_primary_thread() checking only applies to the SMT control but
> not to the CPU offline.

I see, make sense. Retested on my SMT4 Arm64 server with 256 CPUs.



More information about the linux-arm-kernel mailing list