Commit 949338e3 authored by Thomas Gleixner's avatar Thomas Gleixner

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: default avatarThomas 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.deSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 5b7aa87e
...@@ -10,6 +10,7 @@ enum cpuhp_state { ...@@ -10,6 +10,7 @@ enum cpuhp_state {
CPUHP_AP_NOTIFY_STARTING, CPUHP_AP_NOTIFY_STARTING,
CPUHP_AP_ONLINE, CPUHP_AP_ONLINE,
CPUHP_TEARDOWN_CPU, CPUHP_TEARDOWN_CPU,
CPUHP_CPU_SET_ACTIVE,
CPUHP_NOTIFY_ONLINE, CPUHP_NOTIFY_ONLINE,
CPUHP_ONLINE_DYN, CPUHP_ONLINE_DYN,
CPUHP_ONLINE_DYN_END = CPUHP_ONLINE_DYN + 30, CPUHP_ONLINE_DYN_END = CPUHP_ONLINE_DYN + 30,
......
...@@ -666,6 +666,19 @@ void notify_cpu_starting(unsigned int cpu) ...@@ -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) static void undo_cpu_up(unsigned int cpu, struct cpuhp_cpu_state *st)
{ {
for (st->state--; st->state > st->target; st->state--) { for (st->state--; st->state > st->target; st->state--) {
...@@ -941,6 +954,11 @@ static struct cpuhp_step cpuhp_bp_states[] = { ...@@ -941,6 +954,11 @@ static struct cpuhp_step cpuhp_bp_states[] = {
.teardown = takedown_cpu, .teardown = takedown_cpu,
.cant_stop = true, .cant_stop = true,
}, },
[CPUHP_CPU_SET_ACTIVE] = {
.name = "cpu:active",
.startup = cpuhp_set_cpu_active,
.teardown = NULL,
},
[CPUHP_NOTIFY_ONLINE] = { [CPUHP_NOTIFY_ONLINE] = {
.name = "notify:online", .name = "notify:online",
.startup = notify_online, .startup = notify_online,
......
...@@ -5692,16 +5692,6 @@ static int sched_cpu_active(struct notifier_block *nfb, ...@@ -5692,16 +5692,6 @@ static int sched_cpu_active(struct notifier_block *nfb,
set_cpu_rq_start_time(); set_cpu_rq_start_time();
return NOTIFY_OK; return NOTIFY_OK;
case CPU_ONLINE:
/*
* At this point a starting CPU has marked itself as online via
* set_cpu_online(). But it might not yet have marked itself
* as active, which is essential from here on.
*/
set_cpu_active(cpu, true);
stop_machine_unpark(cpu);
return NOTIFY_OK;
case CPU_DOWN_FAILED: case CPU_DOWN_FAILED:
set_cpu_active(cpu, true); set_cpu_active(cpu, true);
return NOTIFY_OK; return NOTIFY_OK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment