Skip to content

Commit

Permalink
arch/hotplug: Call into idle with a proper state
Browse files Browse the repository at this point in the history
Let the non boot cpus call into idle with the corresponding hotplug state, so
the hotplug core can handle the further bringup. That's a first step to
convert the boot side of the hotplugged cpus to do all the synchronization
with the other side through the state machine. For now it'll only start the
hotplug thread and kick the full bringup of the cpu.

Signed-off-by: Thomas Gleixner <[email protected]>
Cc: [email protected]
Cc: Rik van Riel <[email protected]>
Cc: Rafael Wysocki <[email protected]>
Cc: "Srivatsa S. Bhat" <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Arjan van de Ven <[email protected]>
Cc: Sebastian Siewior <[email protected]>
Cc: Rusty Russell <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Paul McKenney <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Paul Turner <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
  • Loading branch information
KAGA-KOKO committed Mar 1, 2016
1 parent 1cf4f62 commit fc6d73d
Show file tree
Hide file tree
Showing 22 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion arch/alpha/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ smp_callin(void)
cpuid, current, current->active_mm));

preempt_disable();
cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
}

/* Wait until hwrpb->txrdy is clear for cpu. Return -1 on timeout. */
Expand Down
2 changes: 1 addition & 1 deletion arch/arc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void start_kernel_secondary(void)

local_irq_enable();
preempt_disable();
cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ asmlinkage void secondary_start_kernel(void)
/*
* OK, it's off to the idle thread for us
*/
cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
}

void __init smp_cpus_done(unsigned int max_cpus)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ asmlinkage void secondary_start_kernel(void)
/*
* OK, it's off to the idle thread for us
*/
cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
}

#ifdef CONFIG_HOTPLUG_CPU
Expand Down
2 changes: 1 addition & 1 deletion arch/blackfin/mach-common/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ void secondary_start_kernel(void)

/* We are done with local CPU inits, unblock the boot CPU. */
set_cpu_online(cpu, true);
cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
}

void __init smp_prepare_boot_cpu(void)
Expand Down
2 changes: 1 addition & 1 deletion arch/hexagon/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void start_secondary(void)

local_irq_enable();

cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
}


Expand Down
2 changes: 1 addition & 1 deletion arch/ia64/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ start_secondary (void *unused)
preempt_disable();
smp_callin();

cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion arch/m32r/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ int __init start_secondary(void *unused)
*/
local_flush_tlb_all();

cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion arch/metag/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ asmlinkage void secondary_start_kernel(void)
/*
* OK, it's off to the idle thread for us
*/
cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
}

void __init smp_cpus_done(unsigned int max_cpus)
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ asmlinkage void start_secondary(void)
WARN_ON_ONCE(!irqs_disabled());
mp_ops->smp_finish();

cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
}

static void stop_this_cpu(void *dummy)
Expand Down
2 changes: 1 addition & 1 deletion arch/mn10300/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ int __init start_secondary(void *unused)
#ifdef CONFIG_GENERIC_CLOCKEVENTS
init_clockevents();
#endif
cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion arch/parisc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ void __init smp_callin(void)

local_irq_enable(); /* Interrupts have been off until now */

cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);

/* NOTREACHED */
panic("smp_callin() AAAAaaaaahhhh....\n");
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ void start_secondary(void *unused)

local_irq_enable();

cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);

BUG();
}
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ static void smp_start_secondary(void *cpuvoid)
set_cpu_online(smp_processor_id(), true);
inc_irq_stat(CPU_RST);
local_irq_enable();
cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
}

/* Upping and downing of CPUs */
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ asmlinkage void start_secondary(void)
set_cpu_online(cpu, true);
per_cpu(cpu_state, cpu) = CPU_ONLINE;

cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
}

extern struct {
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/smp_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ static void sparc_start_secondary(void *arg)
local_irq_enable();

wmb();
cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);

/* We should never reach here! */
BUG();
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/smp_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void smp_callin(void)

local_irq_enable();

cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
}

void cpu_panic(void)
Expand Down
2 changes: 1 addition & 1 deletion arch/tile/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void online_secondary(void)
/* Set up tile-timer clock-event device on this cpu */
setup_tile_timer();

cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
}

int __cpu_up(unsigned int cpu, struct task_struct *tidle)
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ static void notrace start_secondary(void *unused)
x86_cpuinit.setup_percpu_clockev();

wmb();
cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
}

void __init smp_store_boot_cpu_info(void)
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/xen/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ asmlinkage __visible void cpu_bringup_and_idle(int cpu)
xen_pvh_secondary_vcpu_init(cpu);
#endif
cpu_bringup();
cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
}

static void xen_smp_intr_free(unsigned int cpu)
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void secondary_start_kernel(void)

complete(&cpu_running);

cpu_startup_entry(CPUHP_ONLINE);
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
}

static void mx_cpu_start(void *p)
Expand Down
1 change: 1 addition & 0 deletions include/linux/cpuhotplug.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ enum cpuhp_state {
CPUHP_CPU_SET_ACTIVE,
CPUHP_KICK_AP_THREAD,
CPUHP_BP_ONLINE,
CPUHP_AP_ONLINE_IDLE,
CPUHP_AP_SMPBOOT_THREADS,
CPUHP_AP_NOTIFY_ONLINE,
CPUHP_AP_ONLINE_DYN,
Expand Down

0 comments on commit fc6d73d

Please sign in to comment.