mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] stop_machine: build unconditionally if SMP
@ 2011-08-06  7:01 Rabin Vincent
  2011-08-06  8:03 ` Tejun Heo
  0 siblings, 1 reply; 5+ messages in thread
From: Rabin Vincent @ 2011-08-06  7:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Rabin Vincent, x86, Tejun Heo

stop_machine() is built for "(SMP && MODULE_UNLOAD) || HOTPLUG_CPU", but
is also used by the timekeeping code, the mm code, ftrace, and couple of
things in arch/*.  Just build it if we're using SMP, like it's already
the case on x86.

Cc: x86@kernel.org
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Rabin Vincent <rabin@rab.in>
---
 arch/x86/Kconfig             |    1 -
 include/linux/stop_machine.h |    6 +++---
 init/Kconfig                 |    7 -------
 kernel/stop_machine.c        |    4 ----
 4 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 6a47bb2..bb1b397 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2132,7 +2132,6 @@ config HAVE_ATOMIC_IOMAP
 
 config HAVE_TEXT_POKE_SMP
 	bool
-	select STOP_MACHINE if SMP
 
 source "net/Kconfig"
 
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h
index 2d04ea9..37bf3ff 100644
--- a/include/linux/stop_machine.h
+++ b/include/linux/stop_machine.h
@@ -96,7 +96,7 @@ static inline int try_stop_cpus(const struct cpumask *cpumask,
  * grabbing every spinlock (and more).  So the "read" side to such a
  * lock is anything which disables preemption.
  */
-#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP)
+#ifdef CONFIG_SMP
 
 /**
  * stop_machine: freeze the machine on all CPUs and run this function
@@ -127,7 +127,7 @@ 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 */
+#else	 /* CONFIG_SMP */
 
 static inline int __stop_machine(int (*fn)(void *), void *data,
 				 const struct cpumask *cpus)
@@ -152,5 +152,5 @@ static inline int stop_machine_from_inactive_cpu(int (*fn)(void *), void *data,
 	return __stop_machine(fn, data, cpus);
 }
 
-#endif	/* CONFIG_STOP_MACHINE && CONFIG_SMP */
+#endif	/* CONFIG_SMP */
 #endif	/* _LINUX_STOP_MACHINE */
diff --git a/init/Kconfig b/init/Kconfig
index d627783..c32bbfa 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1382,13 +1382,6 @@ config INIT_ALL_POSSIBLE
 	  it was better to provide this option than to break all the archs
 	  and have several arch maintainers pursuing me down dark alleys.
 
-config STOP_MACHINE
-	bool
-	default y
-	depends on (SMP && MODULE_UNLOAD) || HOTPLUG_CPU
-	help
-	  Need stop_machine() primitive.
-
 source "block/Kconfig"
 
 config PREEMPT_NOTIFIERS
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index ba5070c..708bdad 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -390,8 +390,6 @@ static int __init cpu_stop_init(void)
 }
 early_initcall(cpu_stop_init);
 
-#ifdef CONFIG_STOP_MACHINE
-
 /* This controls the threads on each CPU. */
 enum stopmachine_state {
 	/* Dummy starting state for thread. */
@@ -554,5 +552,3 @@ int stop_machine_from_inactive_cpu(int (*fn)(void *), void *data,
 	mutex_unlock(&stop_cpus_mutex);
 	return ret ?: done.ret;
 }
-
-#endif	/* CONFIG_STOP_MACHINE */
-- 
1.7.5.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-08-07  9:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-06  7:01 [PATCH] stop_machine: build unconditionally if SMP Rabin Vincent
2011-08-06  8:03 ` Tejun Heo
2011-08-06 23:38   ` Andrew Morton
2011-08-07  7:39     ` Tejun Heo
2011-08-07  9:30       ` Rabin Vincent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®