Skip to content

Commit d052501

Browse files
KAGA-KOKOpull[bot]
authored andcommitted
x86/smpboot: Remove wait for cpu_online()
Now that the core code drops sparse_irq_lock after the idle thread synchronized, it's pointless to wait for the AP to mark itself online. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Tested-by: Michael Kelley <[email protected]> Tested-by: Oleksandr Natalenko <[email protected]> Tested-by: Helge Deller <[email protected]> # parisc Tested-by: Guilherme G. Piccoli <[email protected]> # Steam Deck Link: https://lore.kernel.org/r/[email protected]
1 parent 3a8d9f1 commit d052501

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

arch/x86/kernel/smpboot.c

+2-24
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ static void notrace start_secondary(void *unused)
275275
* half valid vector space.
276276
*/
277277
lock_vector_lock();
278-
/* Sync point with do_wait_cpu_online() */
279278
set_cpu_online(smp_processor_id(), true);
280279
lapic_online();
281280
unlock_vector_lock();
@@ -1104,20 +1103,6 @@ static int wait_cpu_initialized(unsigned int cpu)
11041103
return 0;
11051104
}
11061105

1107-
/*
1108-
* Bringup step three: Wait for the target AP to reach set_cpu_online() in
1109-
* start_secondary().
1110-
*/
1111-
static void wait_cpu_online(unsigned int cpu)
1112-
{
1113-
/*
1114-
* Wait for the AP to mark itself online, so the core caller
1115-
* can drop sparse_irq_lock.
1116-
*/
1117-
while (!cpu_online(cpu))
1118-
schedule();
1119-
}
1120-
11211106
static int native_kick_ap(unsigned int cpu, struct task_struct *tidle)
11221107
{
11231108
int apicid = apic->cpu_present_to_apicid(cpu);
@@ -1164,16 +1149,9 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
11641149
int ret;
11651150

11661151
ret = native_kick_ap(cpu, tidle);
1167-
if (ret)
1168-
goto out;
1169-
1170-
ret = wait_cpu_initialized(cpu);
1171-
if (ret)
1172-
goto out;
1173-
1174-
wait_cpu_online(cpu);
1152+
if (!ret)
1153+
ret = wait_cpu_initialized(cpu);
11751154

1176-
out:
11771155
/* Cleanup possible dangling ends... */
11781156
if (x86_platform.legacy.warm_reset)
11791157
smpboot_restore_warm_reset_vector();

0 commit comments

Comments
 (0)