summaryrefslogtreecommitdiffstats
path: root/kernel/cpu.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-02-26 19:43:35 +0100
committerThomas Gleixner <tglx@linutronix.de>2016-03-01 20:36:55 +0100
commit949338e35131c551f7bf54f48a2e3a227af6721b (patch)
treed5a8cd72ebe374b653f58263eae8ceb0e06992a2 /kernel/cpu.c
parentcpu/hotplug: Implement setup/removal interface (diff)
downloadlinux-949338e35131c551f7bf54f48a2e3a227af6721b.tar.xz
linux-949338e35131c551f7bf54f48a2e3a227af6721b.zip
cpu/hotplug: Move scheduler cpu_online notifier to hotplug core
Move the scheduler cpu online notifier part to the hotplug core. This is anyway the highest priority callback and we need that functionality right now for the next changes. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: linux-arch@vger.kernel.org Cc: Rik van Riel <riel@redhat.com> Cc: Rafael Wysocki <rafael.j.wysocki@intel.com> Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: Sebastian Siewior <bigeasy@linutronix.de> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Tejun Heo <tj@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Paul McKenney <paulmck@linux.vnet.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul Turner <pjt@google.com> Link: http://lkml.kernel.org/r/20160226182341.200791046@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r--kernel/cpu.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index b5eacb9587af..65e34d34ca93 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -666,6 +666,19 @@ void notify_cpu_starting(unsigned int cpu)
}
}
+/*
+ * Called from the idle task. We need to set active here, so we can kick off
+ * the stopper thread.
+ */
+static int cpuhp_set_cpu_active(unsigned int cpu)
+{
+ /* The cpu is marked online, set it active now */
+ set_cpu_active(cpu, true);
+ /* Unpark the stopper thread */
+ stop_machine_unpark(cpu);
+ return 0;
+}
+
static void undo_cpu_up(unsigned int cpu, struct cpuhp_cpu_state *st)
{
for (st->state--; st->state > st->target; st->state--) {
@@ -941,6 +954,11 @@ static struct cpuhp_step cpuhp_bp_states[] = {
.teardown = takedown_cpu,
.cant_stop = true,
},
+ [CPUHP_CPU_SET_ACTIVE] = {
+ .name = "cpu:active",
+ .startup = cpuhp_set_cpu_active,
+ .teardown = NULL,
+ },
[CPUHP_NOTIFY_ONLINE] = {
.name = "notify:online",
.startup = notify_online,