From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755757AbdDOReO (ORCPT ); Sat, 15 Apr 2017 13:34:14 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:44492 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755185AbdDORbT (ORCPT ); Sat, 15 Apr 2017 13:31:19 -0400 Message-Id: <20170415171652.424719058@linutronix.de> User-Agent: quilt/0.63-1 Date: Sat, 15 Apr 2017 19:01:21 +0200 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Ingo Molnar , Steven Rostedt , Sebastian Siewior Subject: [patch 14/20] kernel/hotplug: Use stop_machine_locked() in takedown_cpu() References: <20170415170107.643253702@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Disposition: inline; filename=cpu-hotplug-Use-stop-machine-locked.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sebastian Andrzej Siewior 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_locked() to avoid the nested call. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner --- kernel/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 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_locked(take_cpu_down, NULL, cpumask_of(cpu)); if (err) { /* CPU refused to die */ irq_unlock_sparse();