linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: SMP: Move the AP sync point before the calibration delay
@ 2025-05-23  7:58 Gregory CLEMENT
  2025-05-25 13:02 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 2+ messages in thread
From: Gregory CLEMENT @ 2025-05-23  7:58 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: Huacai Chen, Jiaxun Yang, Vladimir Kondratiev, Théo Lebrun,
	Tawfik Bayouk, Thomas Petazzoni, linux-mips, linux-kernel,
	Gregory CLEMENT

In the calibration delay process, some resources are shared, so it's
better to move it after the parallel execution part. Thanks to the
patch optimizing CPU delay calibration, this change has no impact on
the boot time improvements gained from CPU parallel boot.

Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
---
Hello,

After a thorough review, as reported in [1], the CPU delay calibration
is the last potential issue area. However, I believe that with this
patch [2] applied, the source of concurrency will disappear.

Gregory

[1]: https://lore.kernel.org/linux-mips/87frgvokga.fsf@BLaptop.bootlin.com/
[2] :https://lore.kernel.org/linux-mips/20250520-smp_calib-v1-1-cd04f0a78648@bootlin.com/
---
 arch/mips/kernel/smp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 7901b59d8f60eddefc020cf2a137716af963f09e..4868e79f3b30e9d80fe6390785b297c35d8c02a3 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -371,12 +371,12 @@ asmlinkage void start_secondary(void)
 	 * to an option instead of something based on .cputype
 	 */
 
-	calibrate_delay();
-	cpu_data[cpu].udelay_val = loops_per_jiffy;
-
 #ifdef CONFIG_HOTPLUG_PARALLEL
 	cpuhp_ap_sync_alive();
 #endif
+	calibrate_delay();
+	cpu_data[cpu].udelay_val = loops_per_jiffy;
+
 	set_cpu_sibling_map(cpu);
 	set_cpu_core_map(cpu);
 

---
base-commit: faefb0a59c5914b7b8f737e2ec5c82822e5bc4c7
change-id: 20250522-hotplug-paralell-fix2-1bffa02a9529

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] MIPS: SMP: Move the AP sync point before the calibration delay
  2025-05-23  7:58 [PATCH] MIPS: SMP: Move the AP sync point before the calibration delay Gregory CLEMENT
@ 2025-05-25 13:02 ` Thomas Bogendoerfer
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Bogendoerfer @ 2025-05-25 13:02 UTC (permalink / raw)
  To: Gregory CLEMENT
  Cc: Huacai Chen, Jiaxun Yang, Vladimir Kondratiev, Théo Lebrun,
	Tawfik Bayouk, Thomas Petazzoni, linux-mips, linux-kernel

On Fri, May 23, 2025 at 09:58:15AM +0200, Gregory CLEMENT wrote:
> In the calibration delay process, some resources are shared, so it's
> better to move it after the parallel execution part. Thanks to the
> patch optimizing CPU delay calibration, this change has no impact on
> the boot time improvements gained from CPU parallel boot.
> 
> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
> ---
> Hello,
> 
> After a thorough review, as reported in [1], the CPU delay calibration
> is the last potential issue area. However, I believe that with this
> patch [2] applied, the source of concurrency will disappear.
> 
> Gregory
> 
> [1]: https://lore.kernel.org/linux-mips/87frgvokga.fsf@BLaptop.bootlin.com/
> [2] :https://lore.kernel.org/linux-mips/20250520-smp_calib-v1-1-cd04f0a78648@bootlin.com/
> ---
>  arch/mips/kernel/smp.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
> index 7901b59d8f60eddefc020cf2a137716af963f09e..4868e79f3b30e9d80fe6390785b297c35d8c02a3 100644
> --- a/arch/mips/kernel/smp.c
> +++ b/arch/mips/kernel/smp.c
> @@ -371,12 +371,12 @@ asmlinkage void start_secondary(void)
>  	 * to an option instead of something based on .cputype
>  	 */
>  
> -	calibrate_delay();
> -	cpu_data[cpu].udelay_val = loops_per_jiffy;
> -
>  #ifdef CONFIG_HOTPLUG_PARALLEL
>  	cpuhp_ap_sync_alive();
>  #endif
> +	calibrate_delay();
> +	cpu_data[cpu].udelay_val = loops_per_jiffy;
> +
>  	set_cpu_sibling_map(cpu);
>  	set_cpu_core_map(cpu);
>  
> 
> ---
> base-commit: faefb0a59c5914b7b8f737e2ec5c82822e5bc4c7
> change-id: 20250522-hotplug-paralell-fix2-1bffa02a9529

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 ]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-25 13:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-23  7:58 [PATCH] MIPS: SMP: Move the AP sync point before the calibration delay Gregory CLEMENT
2025-05-25 13:02 ` Thomas Bogendoerfer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).