Skip to content

Commit 7eeb088

Browse files
oleg-nesterovingomolnar
authored andcommitted
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 <oleg@redhat.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Tejun Heo <tj@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> 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 <mingo@kernel.org>
1 parent b377c2a commit 7eeb088

3 files changed

Lines changed: 4 additions & 22 deletions

File tree

‎include/linux/stop_machine.h‎

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -114,23 +114,11 @@ static inline int try_stop_cpus(const struct cpumask *cpumask,
114114
* grabbing every spinlock in the kernel. */
115115
int stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus);
116116

117-
/**
118-
* __stop_machine: freeze the machine on all CPUs and run this function
119-
* @fn: the function to run
120-
* @data: the data ptr for the @fn
121-
* @cpus: the cpus to run the @fn() on (NULL = any online cpu)
122-
*
123-
* Description: This is a special version of the above, which assumes cpus
124-
* won't come or go while it's being called. Used by hotplug cpu.
125-
*/
126-
int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus);
127-
128117
int stop_machine_from_inactive_cpu(int (*fn)(void *), void *data,
129118
const struct cpumask *cpus);
130-
131119
#else /* CONFIG_STOP_MACHINE && CONFIG_SMP */
132120

133-
static inline int __stop_machine(int (*fn)(void *), void *data,
121+
static inline int stop_machine(int (*fn)(void *), void *data,
134122
const struct cpumask *cpus)
135123
{
136124
unsigned long flags;
@@ -141,16 +129,10 @@ static inline int __stop_machine(int (*fn)(void *), void *data,
141129
return ret;
142130
}
143131

144-
static inline int stop_machine(int (*fn)(void *), void *data,
145-
const struct cpumask *cpus)
146-
{
147-
return __stop_machine(fn, data, cpus);
148-
}
149-
150132
static inline int stop_machine_from_inactive_cpu(int (*fn)(void *), void *data,
151133
const struct cpumask *cpus)
152134
{
153-
return __stop_machine(fn, data, cpus);
135+
return stop_machine(fn, data, cpus);
154136
}
155137

156138
#endif /* CONFIG_STOP_MACHINE && CONFIG_SMP */

‎kernel/cpu.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen)
395395
* So now all preempt/rcu users must observe !cpu_active().
396396
*/
397397

398-
err = __stop_machine(take_cpu_down, &tcd_param, cpumask_of(cpu));
398+
err = stop_machine(take_cpu_down, &tcd_param, cpumask_of(cpu));
399399
if (err) {
400400
/* CPU didn't die: tell everyone. Can't complain. */
401401
cpu_notify_nofail(CPU_DOWN_FAILED | mod, hcpu);

‎kernel/stop_machine.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ early_initcall(cpu_stop_init);
513513

514514
#ifdef CONFIG_STOP_MACHINE
515515

516-
int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus)
516+
static int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus)
517517
{
518518
struct multi_stop_data msdata = {
519519
.fn = fn,

0 commit comments

Comments
 (0)