aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2019-06-08 12:13:57 +0200
committerHeiko Carstens <heiko.carstens@de.ibm.com>2019-06-15 12:25:55 +0200
commit4ecf0a43e729a7e641d800c294faabe87378fc05 (patch)
treed7c164a2215c69a17b319076b64dd99ea1f85351 /kernel
parents390: improve wait logic of stop_machine (diff)
downloadlinux-dev-4ecf0a43e729a7e641d800c294faabe87378fc05.tar.xz
linux-dev-4ecf0a43e729a7e641d800c294faabe87378fc05.zip
processor: get rid of cpu_relax_yield
stop_machine is the only user left of cpu_relax_yield. Given that it now has special semantics which are tied to stop_machine introduce a weak stop_machine_yield function which architectures can override, and get rid of the generic cpu_relax_yield implementation. Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/stop_machine.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index b8b0c5ff8da9..b4f83f7bdf86 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -177,6 +177,11 @@ static void ack_state(struct multi_stop_data *msdata)
set_state(msdata, msdata->state + 1);
}
+void __weak stop_machine_yield(const struct cpumask *cpumask)
+{
+ cpu_relax();
+}
+
/* This is the cpu_stop function which stops the CPU. */
static int multi_cpu_stop(void *data)
{
@@ -204,7 +209,7 @@ static int multi_cpu_stop(void *data)
/* Simple state machine */
do {
/* Chill out and ensure we re-read multi_stop_state. */
- cpu_relax_yield(cpumask);
+ stop_machine_yield(cpumask);
if (msdata->state != curstate) {
curstate = msdata->state;
switch (curstate) {