From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425565AbdEZIkc (ORCPT ); Fri, 26 May 2017 04:40:32 -0400 Received: from terminus.zytor.com ([65.50.211.136]:33375 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422836AbdEZIk2 (ORCPT ); Fri, 26 May 2017 04:40:28 -0400 Date: Fri, 26 May 2017 01:36:42 -0700 From: tip-bot for Sebastian Andrzej Siewior Message-ID: Cc: rostedt@goodmis.org, bigeasy@linutronix.de, benh@kernel.crashing.org, mingo@kernel.org, paulmck@linux.vnet.ibm.com, peterz@infradead.org, tglx@linutronix.de, hpa@zytor.com, mpe@ellerman.id.au, agraf@suse.com, linux-kernel@vger.kernel.org Reply-To: mingo@kernel.org, benh@kernel.crashing.org, bigeasy@linutronix.de, rostedt@goodmis.org, paulmck@linux.vnet.ibm.com, peterz@infradead.org, linux-kernel@vger.kernel.org, agraf@suse.com, tglx@linutronix.de, hpa@zytor.com, mpe@ellerman.id.au In-Reply-To: <20170524081547.809616236@linutronix.de> References: <20170524081547.809616236@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:smp/hotplug] KVM/PPC/Book3S HV: Use cpuhp_setup_state_nocalls_cpuslocked() Git-Commit-ID: 419af25fa4d0974fd758a668c08c369c19392a47 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 419af25fa4d0974fd758a668c08c369c19392a47 Gitweb: http://git.kernel.org/tip/419af25fa4d0974fd758a668c08c369c19392a47 Author: Sebastian Andrzej Siewior AuthorDate: Wed, 24 May 2017 10:15:21 +0200 Committer: Thomas Gleixner CommitDate: Fri, 26 May 2017 10:10:39 +0200 KVM/PPC/Book3S HV: Use cpuhp_setup_state_nocalls_cpuslocked() kvmppc_alloc_host_rm_ops() holds get_online_cpus() while invoking cpuhp_setup_state_nocalls(). cpuhp_setup_state_nocalls() invokes get_online_cpus() as well. This is correct, but prevents the conversion of the hotplug locking to a percpu rwsem. Use cpuhp_setup_state_nocalls_cpuslocked() to avoid the nested call. Convert *_online_cpus() to the new interfaces while at it. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Acked-by: Ingo Molnar Cc: Paul E. McKenney Cc: kvm@vger.kernel.org Cc: Peter Zijlstra Cc: Benjamin Herrenschmidt Cc: Steven Rostedt Cc: kvm-ppc@vger.kernel.org Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Cc: Alexander Graf Link: http://lkml.kernel.org/r/20170524081547.809616236@linutronix.de --- arch/powerpc/kvm/book3s_hv.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 42b7a4f..48a6bd1 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c @@ -3317,7 +3317,7 @@ void kvmppc_alloc_host_rm_ops(void) return; } - get_online_cpus(); + cpus_read_lock(); for (cpu = 0; cpu < nr_cpu_ids; cpu += threads_per_core) { if (!cpu_online(cpu)) @@ -3339,17 +3339,17 @@ void kvmppc_alloc_host_rm_ops(void) l_ops = (unsigned long) ops; if (cmpxchg64((unsigned long *)&kvmppc_host_rm_ops_hv, 0, l_ops)) { - put_online_cpus(); + cpus_read_unlock(); kfree(ops->rm_core); kfree(ops); return; } - cpuhp_setup_state_nocalls(CPUHP_KVM_PPC_BOOK3S_PREPARE, - "ppc/kvm_book3s:prepare", - kvmppc_set_host_core, - kvmppc_clear_host_core); - put_online_cpus(); + cpuhp_setup_state_nocalls_cpuslocked(CPUHP_KVM_PPC_BOOK3S_PREPARE, + "ppc/kvm_book3s:prepare", + kvmppc_set_host_core, + kvmppc_clear_host_core); + cpus_read_unlock(); } void kvmppc_free_host_rm_ops(void)