Re: [PATCH v2 1/3] MIPS: CPS: Improve mips_cps_first_online_in_cluster()
From: Jiaxun Yang
Date: Fri Jul 04 2025 - 14:03:37 EST
在2025年7月4日周五 下午4:13,Gregory CLEMENT写道:
> The initial implementation of this function goes through all the CPUs
> in a cluster to determine if the current CPU is the only one
> running. This process occurs every time the function is called.
>
> However, during boot, we already perform this task, so let's take
> advantage of this opportunity to create and fill a CPU bitmask that
> can be easily and efficiently used later.
>
> This requires creating a single CPU bitmask per cluster, which is why
> it's essential to know how many clusters can be utilized. The default
> setting is 4 clusters, but this value can be changed when configuring
> the kernel or even customized for a given SoC family.
Hmm, I think we should avoid this sort of random limitation.
You can actually store per cluster cpumask_var_t into `mips_cps_cluster_bootcfg`,
which is allocated in cps_prepare_cpus(), and generate cpumask just there.
It should be pretty straightforward to handle.
Thanks!
>
> This patch modifies the function to allow providing the first
> available online CPU when one already exists, which is necessary for
> delay CPU calibration optimization.
>
> Signed-off-by: Gregory CLEMENT <gregory.clement@xxxxxxxxxxx>
> ---
[...]
--
- Jiaxun