Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752854AbcD2Cez (ORCPT ); Thu, 28 Apr 2016 22:34:55 -0400 Received: from e28smtp05.in.ibm.com ([125.16.236.5]:32953 "EHLO e28smtp05.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752356AbcD2Cey (ORCPT ); Thu, 28 Apr 2016 22:34:54 -0400 X-IBM-Helo: d28dlp03.in.ibm.com X-IBM-MailFrom: xinhui@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Message-ID: <5722C834.1030209@linux.vnet.ibm.com> Date: Fri, 29 Apr 2016 10:34:28 +0800 From: Pan Xinhui User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Waiman Long CC: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linuxppc-dev@lists.ozlabs.org, peterz@infradead.org, Boqun Feng , Paul Mackerras , "Paul E. McKenney" , Michael Ellerman , jeremy@goop.org, chrisw@sous-sol.org, akataria@vmware.com, rusty@rustcorp.com.au, gwshan@linux.vnet.ibm.com, adam.buchbinder@gmail.com, tglx@linutronix.de, marc.zyngier@arm.com Subject: Re: [PATCH resend] powerpc: enable qspinlock and its virtualization support References: <5721EC0E.8040506@linux.vnet.ibm.com> <57227BAA.7040807@hpe.com> In-Reply-To: <57227BAA.7040807@hpe.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16042902-0017-0000-0000-00001E610EE5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3287 Lines: 82 On 2016年04月29日 05:07, Waiman Long wrote: > On 04/28/2016 06:55 AM, Pan Xinhui wrote: >> From: Pan Xinhui >> >> This patch aims to enable qspinlock on PPC. And on pseries platform, it also support >> paravirt qspinlock. >> >> Signed-off-by: Pan Xinhui >> --- >> arch/powerpc/include/asm/qspinlock.h | 37 +++++++++++++++ >> arch/powerpc/include/asm/qspinlock_paravirt.h | 36 +++++++++++++++ >> .../powerpc/include/asm/qspinlock_paravirt_types.h | 13 ++++++ >> arch/powerpc/include/asm/spinlock.h | 31 ++++++++----- >> arch/powerpc/include/asm/spinlock_types.h | 4 ++ >> arch/powerpc/kernel/paravirt.c | 52 ++++++++++++++++++++++ >> arch/powerpc/lib/locks.c | 32 +++++++++++++ >> arch/powerpc/platforms/pseries/setup.c | 5 +++ >> 8 files changed, 198 insertions(+), 12 deletions(-) >> create mode 100644 arch/powerpc/include/asm/qspinlock.h >> create mode 100644 arch/powerpc/include/asm/qspinlock_paravirt.h >> create mode 100644 arch/powerpc/include/asm/qspinlock_paravirt_types.h >> create mode 100644 arch/powerpc/kernel/paravirt.c >> >> > > This is just an enablement patch. You will also need a patch to activate qspinlock for, at lease, some PPC configs. Right? > yep, I want to enable these config and makefile at last. it just looks like diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 2da380f..ae7c2f1 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile @@ -50,6 +50,7 @@ obj-$(CONFIG_PPC_970_NAP) += idle_power4.o obj-$(CONFIG_PPC_P7_NAP) += idle_power7.o procfs-y := proc_powerpc.o obj-$(CONFIG_PROC_FS) += $(procfs-y) +obj-$(CONFIG_PARAVIRT_SPINLOCKS) += paravirt.o rtaspci-$(CONFIG_PPC64)-$(CONFIG_PCI) := rtas_pci.o obj-$(CONFIG_PPC_RTAS) += rtas.o rtas-rtc.o $(rtaspci-y-y) obj-$(CONFIG_PPC_RTAS_DAEMON) += rtasd.o diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig index bec90fb..46632e4 100644 --- a/arch/powerpc/platforms/pseries/Kconfig +++ b/arch/powerpc/platforms/pseries/Kconfig @@ -21,6 +21,7 @@ config PPC_PSERIES select HOTPLUG_CPU if SMP select ARCH_RANDOM select PPC_DOORBELL + select ARCH_USE_QUEUED_SPINLOCKS default y config PPC_SPLPAR @@ -127,3 +128,11 @@ config HV_PERF_CTRS systems. 24x7 is available on Power 8 systems. If unsure, select Y. + +config PARAVIRT_SPINLOCKS + bool "Paravirtialization support for qspinlock" + depends on PPC_SPLPAR && QUEUED_SPINLOCKS + default y + help + If platform supports virtualization, for example PowerVM, this option + can let guest have a better performace. -- 2.4.3 > It has dependency on the pv_wait() patch that I sent out extend the parameter list. Some performance data on how PPC system will perform with and without qspinlock will also be helpful data points. > For now, pv_wait defined in ppc is static inline void pv_wait(u8 *ptr, u8 val) My plan is that waiting your patch goes in kernel tree first, then I send out another patch to extend the parameter list. yes, I need copy some performance data in my patch's comments. thanks xinhui > Cheers, > Longman >