From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752828AbbJTJfK (ORCPT ); Tue, 20 Oct 2015 05:35:10 -0400 Received: from terminus.zytor.com ([198.137.202.10]:49805 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753755AbbJTJfD (ORCPT ); Tue, 20 Oct 2015 05:35:03 -0400 Date: Tue, 20 Oct 2015 02:34:21 -0700 From: tip-bot for Peter Zijlstra Message-ID: Cc: mingo@kernel.org, riel@redhat.com, tglx@linutronix.de, efault@gmx.de, hpa@zytor.com, linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com, oleg@redhat.com, torvalds@linux-foundation.org, tj@kernel.org, peterz@infradead.org, akpm@linux-foundation.org Reply-To: tglx@linutronix.de, mingo@kernel.org, riel@redhat.com, oleg@redhat.com, paulmck@linux.vnet.ibm.com, torvalds@linux-foundation.org, hpa@zytor.com, efault@gmx.de, linux-kernel@vger.kernel.org, tj@kernel.org, peterz@infradead.org, akpm@linux-foundation.org In-Reply-To: <20151009160054.GA10176@redhat.com> References: <20151009160054.GA10176@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched: Start stopper early Git-Commit-ID: 07f06cb3b5f6bd21374a48dbefdb431d71d53974 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: 07f06cb3b5f6bd21374a48dbefdb431d71d53974 Gitweb: http://git.kernel.org/tip/07f06cb3b5f6bd21374a48dbefdb431d71d53974 Author: Peter Zijlstra AuthorDate: Fri, 9 Oct 2015 18:00:54 +0200 Committer: Ingo Molnar CommitDate: Tue, 20 Oct 2015 10:25:55 +0200 sched: Start stopper early Ensure the stopper thread is active 'early', because the load balancer pretty much assumes that its available. And when 'online && active' the load-balancer is fully available. Not only the numa balancing stop_two_cpus() caller relies on it, but also the self migration stuff does, and at CPU_ONLINE time the cpu really is 'free' to run anything. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Oleg Nesterov Signed-off-by: Peter Zijlstra (Intel) Cc: Andrew Morton Cc: Linus Torvalds Cc: Mike Galbraith Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Rik van Riel Cc: Tejun Heo Cc: Thomas Gleixner Cc: heiko.carstens@de.ibm.com Link: http://lkml.kernel.org/r/20151009160054.GA10176@redhat.com Signed-off-by: Ingo Molnar --- kernel/cpu.c | 1 - kernel/sched/core.c | 12 +++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/kernel/cpu.c b/kernel/cpu.c index 6467521..c85df27 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -475,7 +475,6 @@ static int smpboot_thread_call(struct notifier_block *nfb, case CPU_DOWN_FAILED: case CPU_ONLINE: - stop_machine_unpark(cpu); smpboot_unpark_threads(cpu); break; diff --git a/kernel/sched/core.c b/kernel/sched/core.c index f45a7c7..7ee8cae 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5545,21 +5545,27 @@ static void set_cpu_rq_start_time(void) static int sched_cpu_active(struct notifier_block *nfb, unsigned long action, void *hcpu) { + int cpu = (long)hcpu; + switch (action & ~CPU_TASKS_FROZEN) { case CPU_STARTING: 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. - * - * Thus, fall-through and help the starting CPU along. */ + set_cpu_active(cpu, true); + stop_machine_unpark(cpu); + return NOTIFY_OK; + case CPU_DOWN_FAILED: - set_cpu_active((long)hcpu, true); + set_cpu_active(cpu, true); return NOTIFY_OK; + default: return NOTIFY_DONE; }