From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932232AbbHCRKO (ORCPT ); Mon, 3 Aug 2015 13:10:14 -0400 Received: from terminus.zytor.com ([198.137.202.10]:40505 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754306AbbHCRKL (ORCPT ); Mon, 3 Aug 2015 13:10:11 -0400 Date: Mon, 3 Aug 2015 10:09:22 -0700 From: tip-bot for Oleg Nesterov Message-ID: Cc: hpa@zytor.com, peterz@infradead.org, tj@kernel.org, linux-kernel@vger.kernel.org, efault@gmx.de, torvalds@linux-foundation.org, mingo@kernel.org, oleg@redhat.com, tglx@linutronix.de Reply-To: tglx@linutronix.de, oleg@redhat.com, mingo@kernel.org, torvalds@linux-foundation.org, efault@gmx.de, linux-kernel@vger.kernel.org, tj@kernel.org, peterz@infradead.org, hpa@zytor.com In-Reply-To: <20150630012951.GA23934@redhat.com> References: <20150630012951.GA23934@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] stop_machine: Unexport __stop_machine() Git-Commit-ID: 7eeb088e72048bf4660f64fc3824c8066cf17591 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: 7eeb088e72048bf4660f64fc3824c8066cf17591 Gitweb: http://git.kernel.org/tip/7eeb088e72048bf4660f64fc3824c8066cf17591 Author: Oleg Nesterov AuthorDate: Tue, 30 Jun 2015 03:29:51 +0200 Committer: Ingo Molnar CommitDate: Mon, 3 Aug 2015 12:21:26 +0200 stop_machine: Unexport __stop_machine() The only caller outside of stop_machine.c is _cpu_down(), it can use stop_machine(). get_online_cpus() is fine under cpu_hotplug_begin(). Signed-off-by: Oleg Nesterov Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Tejun Heo Cc: Thomas Gleixner Cc: dave@stgolabs.net Cc: der.herr@hofr.at Cc: paulmck@linux.vnet.ibm.com Cc: riel@redhat.com Cc: viro@ZenIV.linux.org.uk Link: http://lkml.kernel.org/r/20150630012951.GA23934@redhat.com Signed-off-by: Ingo Molnar --- include/linux/stop_machine.h | 22 ++-------------------- kernel/cpu.c | 2 +- kernel/stop_machine.c | 2 +- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h index d2abbdb..0fca276 100644 --- a/include/linux/stop_machine.h +++ b/include/linux/stop_machine.h @@ -114,23 +114,11 @@ static inline int try_stop_cpus(const struct cpumask *cpumask, * grabbing every spinlock in the kernel. */ int stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); -/** - * __stop_machine: freeze the machine on all CPUs and run this function - * @fn: the function to run - * @data: the data ptr for the @fn - * @cpus: the cpus to run the @fn() on (NULL = any online cpu) - * - * Description: This is a special version of the above, which assumes cpus - * won't come or go while it's being called. Used by hotplug cpu. - */ -int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); - int stop_machine_from_inactive_cpu(int (*fn)(void *), void *data, const struct cpumask *cpus); - #else /* CONFIG_STOP_MACHINE && CONFIG_SMP */ -static inline int __stop_machine(int (*fn)(void *), void *data, +static inline int stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus) { unsigned long flags; @@ -141,16 +129,10 @@ static inline int __stop_machine(int (*fn)(void *), void *data, return ret; } -static inline int stop_machine(int (*fn)(void *), void *data, - const struct cpumask *cpus) -{ - return __stop_machine(fn, data, cpus); -} - static inline int stop_machine_from_inactive_cpu(int (*fn)(void *), void *data, const struct cpumask *cpus) { - return __stop_machine(fn, data, cpus); + return stop_machine(fn, data, cpus); } #endif /* CONFIG_STOP_MACHINE && CONFIG_SMP */ diff --git a/kernel/cpu.c b/kernel/cpu.c index 9c9c9fa..664ce52 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -395,7 +395,7 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen) * So now all preempt/rcu users must observe !cpu_active(). */ - err = __stop_machine(take_cpu_down, &tcd_param, cpumask_of(cpu)); + err = stop_machine(take_cpu_down, &tcd_param, cpumask_of(cpu)); if (err) { /* CPU didn't die: tell everyone. Can't complain. */ cpu_notify_nofail(CPU_DOWN_FAILED | mod, hcpu); diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c index 6212208..b50910d 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c @@ -513,7 +513,7 @@ early_initcall(cpu_stop_init); #ifdef CONFIG_STOP_MACHINE -int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus) +static int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus) { struct multi_stop_data msdata = { .fn = fn,