Skip to content

Commit

Permalink
x86/smpboot: Remove wait for cpu_online()
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
KAGA-KOKO authored and pull[bot] committed Jun 27, 2023
1 parent 3a8d9f1 commit d052501
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions arch/x86/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ static void notrace start_secondary(void *unused)
* half valid vector space.
*/
lock_vector_lock();
/* Sync point with do_wait_cpu_online() */
set_cpu_online(smp_processor_id(), true);
lapic_online();
unlock_vector_lock();
Expand Down Expand Up @@ -1104,20 +1103,6 @@ static int wait_cpu_initialized(unsigned int cpu)
return 0;
}

/*
* Bringup step three: Wait for the target AP to reach set_cpu_online() in
* start_secondary().
*/
static void wait_cpu_online(unsigned int cpu)
{
/*
* Wait for the AP to mark itself online, so the core caller
* can drop sparse_irq_lock.
*/
while (!cpu_online(cpu))
schedule();
}

static int native_kick_ap(unsigned int cpu, struct task_struct *tidle)
{
int apicid = apic->cpu_present_to_apicid(cpu);
Expand Down Expand Up @@ -1164,16 +1149,9 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
int ret;

ret = native_kick_ap(cpu, tidle);
if (ret)
goto out;

ret = wait_cpu_initialized(cpu);
if (ret)
goto out;

wait_cpu_online(cpu);
if (!ret)
ret = wait_cpu_initialized(cpu);

out:
/* Cleanup possible dangling ends... */
if (x86_platform.legacy.warm_reset)
smpboot_restore_warm_reset_vector();
Expand Down

0 comments on commit d052501

Please sign in to comment.