[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87iklsofih.fsf@BLaptop.bootlin.com>
Date: Thu, 22 May 2025 17:02:14 +0200
From: Gregory CLEMENT <gregory.clement@...tlin.com>
To: Jiaxun Yang <jiaxun.yang@...goat.com>, Thomas Bogendoerfer
<tsbogend@...ha.franken.de>
Cc: Vladimir Kondratiev <vladimir.kondratiev@...ileye.com>, Théo Lebrun
<theo.lebrun@...tlin.com>, Tawfik Bayouk <tawfik.bayouk@...ileye.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
"linux-mips@...r.kernel.org" <linux-mips@...r.kernel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] MIPS: CPS: Optimise delay CPU calibration for SMP
Hello Jiaxun Yang,
> 在2025年5月21日周三 上午8:47,Gregory CLEMENT写道:
>> Hello Jiaxun,
>>
>>> 在2025年5月20日周二 下午4:21,Gregory CLEMENT写道:
>>> [...]
>>>>
>>>> This allows to implement calibrate_delay_is_known(), which will return
>>>> 0 (triggering calibration) only for the primary CPU of each
>>>> cluster. For other CPUs, we can simply reuse the value from their
>>>> cluster's primary CPU core.
>>>
>>> Is __cpu_primary_cluster_mask really necessary?
>>>
>>> Maybe we can just test if current CPU is the first powered up CPU
>>> in the cluster?
>>
>> That is exactly the point of __cpu_primary_cluster_mask: setting in an
>> efficient way the first powered-up CPU for each cluster. This adds only
>> a single variable (which is actually just a long) and allows for minimal
>> impact during boot time, by doing the minimum write and read operations
>>
>> I don't see a better alternative. What do you have in mind ?
>
> Maybe we can try mips_cps_first_online_in_cluster()?
I didn't notice this function initially, but upon closer inspection, it
appears that although the scan process is optimized, it still performs a
full scan for each CPU during boot. In contrast, with the mask, the
information is created only once and within an existing loop.
I believe this function would benefit from __cpu_primary_cluster_mask,
which is why I prefer my current implementation over using
mips_cps_first_online_in_cluster().
Regards,
Thanks
>
> [...]
>
> Thanks
>
> --
> - Jiaxun
--
Grégory CLEMENT, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Powered by blists - more mailing lists