Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1651226 > unrolled thread

[tip:smp/hotplug] cpu/hotplug: Use stop_machine_cpuslocked() in takedown_cpu()

Started bytip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com>
First post2017-05-26 10:50 +0200
Last post2017-05-26 10:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [tip:smp/hotplug] cpu/hotplug: Use stop_machine_cpuslocked() in  takedown_cpu() tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2017-05-26 10:50 +0200

#1651226 — [tip:smp/hotplug] cpu/hotplug: Use stop_machine_cpuslocked() in takedown_cpu()

Fromtip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com>
Date2017-05-26 10:50 +0200
Subject[tip:smp/hotplug] cpu/hotplug: Use stop_machine_cpuslocked() in takedown_cpu()
Message-ID<tLj6z-3Cw-29@gated-at.bofh.it>
Commit-ID:  210e21331fc3a396af640cec652be769d146e49f
Gitweb:     http://git.kernel.org/tip/210e21331fc3a396af640cec652be769d146e49f
Author:     Sebastian Andrzej Siewior <bigeasy@linutronix.de>
AuthorDate: Wed, 24 May 2017 10:15:28 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 26 May 2017 10:10:42 +0200

cpu/hotplug: Use stop_machine_cpuslocked() in takedown_cpu()

takedown_cpu() is a cpu hotplug function invoking stop_machine(). The cpu
hotplug machinery holds the hotplug lock for write.

stop_machine() invokes get_online_cpus() as well. This is correct, but
prevents the conversion of the hotplug locking to a percpu rwsem.

Use stop_machine_cpuslocked() to avoid the nested call.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20170524081548.423292433@linutronix.de

---
 kernel/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index e4389ac..142d889 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -701,7 +701,7 @@ static int takedown_cpu(unsigned int cpu)
 	/*
 	 * So now all preempt/rcu users must observe !cpu_active().
 	 */
-	err = stop_machine(take_cpu_down, NULL, cpumask_of(cpu));
+	err = stop_machine_cpuslocked(take_cpu_down, NULL, cpumask_of(cpu));
 	if (err) {
 		/* CPU refused to die */
 		irq_unlock_sparse();

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web