From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754085AbcCAT4j (ORCPT ); Tue, 1 Mar 2016 14:56:39 -0500 Received: from torg.zytor.com ([198.137.202.12]:44474 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750813AbcCAT4g (ORCPT ); Tue, 1 Mar 2016 14:56:36 -0500 Date: Tue, 1 Mar 2016 11:55:48 -0800 From: tip-bot for Thomas Gleixner Message-ID: Cc: rostedt@goodmis.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, bigeasy@linutronix.de, rafael.j.wysocki@intel.com, peterz@infradead.org, rusty@rustcorp.com.au, pjt@google.com, hpa@zytor.com, tglx@linutronix.de, arjan@linux.intel.com, srivatsa@mit.edu, mingo@kernel.org, riel@redhat.com, oleg@redhat.com, linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com, tj@kernel.org Reply-To: pjt@google.com, akpm@linux-foundation.org, torvalds@linux-foundation.org, rostedt@goodmis.org, peterz@infradead.org, rusty@rustcorp.com.au, rafael.j.wysocki@intel.com, bigeasy@linutronix.de, mingo@kernel.org, srivatsa@mit.edu, arjan@linux.intel.com, tj@kernel.org, oleg@redhat.com, paulmck@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, riel@redhat.com, hpa@zytor.com, tglx@linutronix.de In-Reply-To: <20160226182341.200791046@linutronix.de> References: <20160226182341.200791046@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:smp/hotplug] cpu/hotplug: Move scheduler cpu_online notifier to hotplug core Git-Commit-ID: 949338e35131c551f7bf54f48a2e3a227af6721b X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 949338e35131c551f7bf54f48a2e3a227af6721b Gitweb: http://git.kernel.org/tip/949338e35131c551f7bf54f48a2e3a227af6721b Author: Thomas Gleixner AuthorDate: Fri, 26 Feb 2016 18:43:35 +0000 Committer: Thomas Gleixner CommitDate: Tue, 1 Mar 2016 20:36:55 +0100 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 Cc: linux-arch@vger.kernel.org Cc: Rik van Riel Cc: Rafael Wysocki Cc: "Srivatsa S. Bhat" Cc: Peter Zijlstra Cc: Arjan van de Ven Cc: Sebastian Siewior Cc: Rusty Russell Cc: Steven Rostedt Cc: Oleg Nesterov Cc: Tejun Heo Cc: Andrew Morton Cc: Paul McKenney Cc: Linus Torvalds Cc: Paul Turner Link: http://lkml.kernel.org/r/20160226182341.200791046@linutronix.de Signed-off-by: Thomas Gleixner --- include/linux/cpuhotplug.h | 1 + kernel/cpu.c | 18 ++++++++++++++++++ kernel/sched/core.c | 10 ---------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index 2993526..2f2e5d9 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h @@ -10,6 +10,7 @@ enum cpuhp_state { CPUHP_AP_NOTIFY_STARTING, CPUHP_AP_ONLINE, CPUHP_TEARDOWN_CPU, + CPUHP_CPU_SET_ACTIVE, CPUHP_NOTIFY_ONLINE, CPUHP_ONLINE_DYN, CPUHP_ONLINE_DYN_END = CPUHP_ONLINE_DYN + 30, diff --git a/kernel/cpu.c b/kernel/cpu.c index b5eacb9..65e34d3 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, diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 9503d59..6266463 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5692,16 +5692,6 @@ static int sched_cpu_active(struct notifier_block *nfb, set_cpu_rq_start_time(); 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: set_cpu_active(cpu, true); return NOTIFY_OK;