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

* Re: [PATCH] stop_machine: build unconditionally if SMP
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Tejun Heo @ 2011-08-06  8:03 UTC (permalink / raw)
  To: Rabin Vincent; +Cc: linux-kernel, Andrew Morton, x86

Hello,

On Sat, Aug 06, 2011 at 12:31:13PM +0530, Rabin Vincent wrote:
> 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>

Yeah, looks good to me.

Acked-by: Tejun Heo <tj@kernel.org>

Andrew, can you please route this one?

Thank you.

-- 
tejun

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

* Re: [PATCH] stop_machine: build unconditionally if SMP
  2011-08-06  8:03 ` Tejun Heo
@ 2011-08-06 23:38   ` Andrew Morton
  2011-08-07  7:39     ` Tejun Heo
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2011-08-06 23:38 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Rabin Vincent, linux-kernel, x86

On Sat, 6 Aug 2011 10:03:23 +0200 Tejun Heo <tj@kernel.org> wrote:

> Hello,
> 
> On Sat, Aug 06, 2011 at 12:31:13PM +0530, Rabin Vincent wrote:
> > 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>
> 
> Yeah, looks good to me.
> 
> Acked-by: Tejun Heo <tj@kernel.org>
> 
> Andrew, can you please route this one?
> 

Sure.

The priority is unclear.  It appears that the patch fixes a build error
under sone circumstances in current mainline?

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

* Re: [PATCH] stop_machine: build unconditionally if SMP
  2011-08-06 23:38   ` Andrew Morton
@ 2011-08-07  7:39     ` Tejun Heo
  2011-08-07  9:30       ` Rabin Vincent
  0 siblings, 1 reply; 5+ messages in thread
From: Tejun Heo @ 2011-08-07  7:39 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Rabin Vincent, linux-kernel, x86

Hello,

On Sat, Aug 06, 2011 at 04:38:37PM -0700, Andrew Morton wrote:
> The priority is unclear.  It appears that the patch fixes a build error
> under sone circumstances in current mainline?

I don't think it would have triggered build error as there are dummy
functions which just calls the function on the local CPU, but it does
look pretty broken now.  e.g. ia64 supports memory hotplug which
depends on stop machine but it would still be using dummy local
version, which can't be right.

Robin, is there an open bug report regarding this issue?  I'm not sure
enough to suggest -stable but definitely mainline material.

Thanks.

-- 
tejun

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

* Re: [PATCH] stop_machine: build unconditionally if SMP
  2011-08-07  7:39     ` Tejun Heo
@ 2011-08-07  9:30       ` Rabin Vincent
  0 siblings, 0 replies; 5+ messages in thread
From: Rabin Vincent @ 2011-08-07  9:30 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Andrew Morton, linux-kernel, x86

On Sun, Aug 7, 2011 at 13:09, Tejun Heo <tj@kernel.org> wrote:
> On Sat, Aug 06, 2011 at 04:38:37PM -0700, Andrew Morton wrote:
>> The priority is unclear.  It appears that the patch fixes a build error
>> under sone circumstances in current mainline?
>
> I don't think it would have triggered build error as there are dummy
> functions which just calls the function on the local CPU, but it does
> look pretty broken now.  e.g. ia64 supports memory hotplug which
> depends on stop machine but it would still be using dummy local
> version, which can't be right.

Right.  Although I guess most people build with MODULE_UNLOAD enabled,
so wouldn't hit the problem.

> Robin, is there an open bug report regarding this issue?  I'm not sure
> enough to suggest -stable but definitely mainline material.

There's no bug report.  I noticed it because I sometimes build ARM
kernels with module support and HOTPLUG_CPU disabled.

^ 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®