Skip to content

Commit 4cc7543

Browse files
gclementtsbogend
authored andcommitted
MIPS: SMP: Move the AP sync point before the non-parallel aware functions
When CONFIG_HOTPLUG_PARALLEL is enabled, the code executing before cpuhp_ap_sync_alive() is executed in parallel, while after it is serialized. The functions set_cpu_sibling_map() and set_cpu_core_map() were not designed to be executed in parallel, so by moving the cpuhp_ap_sync_alive() before cpuhp_ap_sync_alive(), we then ensure they will be called serialized. The measurement done on EyeQ5 did not show any relevant boot time increase after applying this patch. Fixes: 76c43eb ("MIPS: SMP: Implement parallel CPU bring up for EyeQ") Reported-by: Huacai Chen <[email protected]> Signed-off-by: Gregory CLEMENT <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 3b37042 commit 4cc7543

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/mips/kernel/smp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,13 +374,13 @@ asmlinkage void start_secondary(void)
374374
calibrate_delay();
375375
cpu_data[cpu].udelay_val = loops_per_jiffy;
376376

377+
#ifdef CONFIG_HOTPLUG_PARALLEL
378+
cpuhp_ap_sync_alive();
379+
#endif
377380
set_cpu_sibling_map(cpu);
378381
set_cpu_core_map(cpu);
379382

380383
cpumask_set_cpu(cpu, &cpu_coherent_mask);
381-
#ifdef CONFIG_HOTPLUG_PARALLEL
382-
cpuhp_ap_sync_alive();
383-
#endif
384384
notify_cpu_starting(cpu);
385385

386386
#ifndef CONFIG_HOTPLUG_PARALLEL

0 commit comments

Comments
 (0)