Re: [PATCH v5 1/4] cpu/SMT: Provide a default topology_is_primary_thread()

From: Yicong Yang
Date: Mon Aug 19 2024 - 03:25:29 EST


On 2024/8/16 23:54, Dietmar Eggemann wrote:
> On 06/08/2024 10:53, Yicong Yang wrote:
>> From: Yicong Yang <yangyicong@xxxxxxxxxxxxx>
>>
>> Currently if architectures want to support HOTPLUG_SMT they need to
>> provide a topology_is_primary_thread() telling the framework which
>> thread in the SMT cannot offline. However arm64 doesn't have a
>> restriction on which thread in the SMT cannot offline, a simplest
>> choice is that just make 1st thread as the "primary" thread. So
>> just make this as the default implementation in the framework and
>> let architectures like x86 that have special primary thread to
>> override this function.
>
> IMHO, ARM64 (/ARM), RISCV and PARISC (SMP) use GENERIC_ARCH_TOPOLOGY
> (and drivers/base/arch_topology.c) so they could share
> topology_is_primary_thread() also there?
>

I think yes, if they want to implement HOTPLUG_SMT and don't have a restriction
on the primary thread.

Thanks.