[PATCH v4 0/2] MIPS: CPS: Optimise delay CPU calibration and cluster helper function

Gregory CLEMENT posted 2 patches 2 months, 3 weeks ago
arch/mips/include/asm/mips-cps.h |  4 +++-
arch/mips/include/asm/smp-cps.h  |  1 +
arch/mips/kernel/mips-cm.c       | 47 ++++++++++++++--------------------------
arch/mips/kernel/smp-cps.c       | 16 +++++++++++++-
4 files changed, 35 insertions(+), 33 deletions(-)
[PATCH v4 0/2] MIPS: CPS: Optimise delay CPU calibration and cluster helper function
Posted by Gregory CLEMENT 2 months, 3 weeks ago
This series allow booting faster by reusing the delay calibration
across the CPU belonging of the same cluster. While doing it we now
reuse the mips_cps_first_online_in_cluster() that we improve also.

This series enables faster booting by reusing delay calibration across
CPUs within the same cluster. During this process, we reuse the
improved mips_cps_first_online_in_cluster function.

With the introduction of this series, a configuration running 32 cores
spread across two clusters sees a significant reduction in boot time
by approximately 600 milliseconds.

Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
---
Changes in v4:
- Fix build issue reported by kernel test robot <lkp@intel.com>
  at https://lore.kernel.org/all/aG3AJ2XnH2JKOjzY@rli9-mobl/#t
- Add reviewed-by tags from Jiaxun
- Link to v3: https://lore.kernel.org/r/20250708-smp_calib-v3-0-6dabf01a7d9f@bootlin.com

Changes in v3:
- Do not depend anymore of a Kconfig entry (suggested by Jiaxun).
- cpumask for cluster filled now later in cps_prepare_cpus().
- Patch 2 of the v2 has been removed.
- Link to v2: https://lore.kernel.org/r/20250704-smp_calib-v2-0-bade7e9c0463@bootlin.com

Changes in v2:
- Add a patch improving mips_cps_first_online_in_cluster()
- Use mips_cps_first_online_in_cluster() in calibrate_delay_is_known()
  as suggested by Jiaxun
- Link to v1: https://lore.kernel.org/r/20250520-smp_calib-v1-1-cd04f0a78648@bootlin.com

---
Gregory CLEMENT (2):
      MIPS: CPS: Improve mips_cps_first_online_in_cluster()
      MIPS: CPS: Optimise delay CPU calibration for SMP

 arch/mips/include/asm/mips-cps.h |  4 +++-
 arch/mips/include/asm/smp-cps.h  |  1 +
 arch/mips/kernel/mips-cm.c       | 47 ++++++++++++++--------------------------
 arch/mips/kernel/smp-cps.c       | 16 +++++++++++++-
 4 files changed, 35 insertions(+), 33 deletions(-)
---
base-commit: 86731a2a651e58953fc949573895f2fa6d456841
change-id: 20250520-smp_calib-6d3009e1f5b9

Best regards,
-- 
Grégory CLEMENT, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Re: [PATCH v4 0/2] MIPS: CPS: Optimise delay CPU calibration and cluster helper function
Posted by Thomas Bogendoerfer 2 months, 3 weeks ago
On Fri, Jul 11, 2025 at 11:54:19AM +0200, Gregory CLEMENT wrote:
> This series allow booting faster by reusing the delay calibration
> across the CPU belonging of the same cluster. While doing it we now
> reuse the mips_cps_first_online_in_cluster() that we improve also.
> 
> This series enables faster booting by reusing delay calibration across
> CPUs within the same cluster. During this process, we reuse the
> improved mips_cps_first_online_in_cluster function.
> 
> With the introduction of this series, a configuration running 32 cores
> spread across two clusters sees a significant reduction in boot time
> by approximately 600 milliseconds.
> 
> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
> ---
> Changes in v4:
> - Fix build issue reported by kernel test robot <lkp@intel.com>
>   at https://lore.kernel.org/all/aG3AJ2XnH2JKOjzY@rli9-mobl/#t
> - Add reviewed-by tags from Jiaxun
> - Link to v3: https://lore.kernel.org/r/20250708-smp_calib-v3-0-6dabf01a7d9f@bootlin.com
> 
> Changes in v3:
> - Do not depend anymore of a Kconfig entry (suggested by Jiaxun).
> - cpumask for cluster filled now later in cps_prepare_cpus().
> - Patch 2 of the v2 has been removed.
> - Link to v2: https://lore.kernel.org/r/20250704-smp_calib-v2-0-bade7e9c0463@bootlin.com
> 
> Changes in v2:
> - Add a patch improving mips_cps_first_online_in_cluster()
> - Use mips_cps_first_online_in_cluster() in calibrate_delay_is_known()
>   as suggested by Jiaxun
> - Link to v1: https://lore.kernel.org/r/20250520-smp_calib-v1-1-cd04f0a78648@bootlin.com
> 
> ---
> Gregory CLEMENT (2):
>       MIPS: CPS: Improve mips_cps_first_online_in_cluster()
>       MIPS: CPS: Optimise delay CPU calibration for SMP
> 
>  arch/mips/include/asm/mips-cps.h |  4 +++-
>  arch/mips/include/asm/smp-cps.h  |  1 +
>  arch/mips/kernel/mips-cm.c       | 47 ++++++++++++++--------------------------
>  arch/mips/kernel/smp-cps.c       | 16 +++++++++++++-
>  4 files changed, 35 insertions(+), 33 deletions(-)

series applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]