From: Rabin Vincent <rabin@rab.in>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
Rabin Vincent <rabin@rab.in>,
x86@kernel.org, Tejun Heo <tj@kernel.org>
Subject: [PATCH] stop_machine: build unconditionally if SMP
Date: Sat, 6 Aug 2011 12:31:13 +0530 [thread overview]
Message-ID: <1312614073-11516-1-git-send-email-rabin@rab.in> (raw)
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
next reply other threads:[~2011-08-06 7:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-06 7:01 Rabin Vincent [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1312614073-11516-1-git-send-email-rabin@rab.in \
--to=rabin@rab.in \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®