Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753313AbcDNIcr (ORCPT ); Thu, 14 Apr 2016 04:32:47 -0400 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:55935 "EHLO e23smtp04.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751879AbcDNIco (ORCPT ); Thu, 14 Apr 2016 04:32:44 -0400 X-IBM-Helo: d23dlp03.au.ibm.com X-IBM-MailFrom: xinhui@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Message-ID: <570F5557.1070207@linux.vnet.ibm.com> Date: Thu, 14 Apr 2016 16:31:19 +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: Peter Zijlstra , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Boqun Feng , Thomas Gleixner Subject: Re: [PATCH] powerpc: introduce {cmp}xchg for u8 and u16 References: <570752AA.9050603@linux.vnet.ibm.com> <20160408074744.GU3430@twins.programming.kicks-ass.net> <570A6078.2050002@linux.vnet.ibm.com> <20160412143023.GH1087@worktop> <570E2A45.9080702@linux.vnet.ibm.com> <570E6B76.5080306@hpe.com> In-Reply-To: <570E6B76.5080306@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: 16041408-0013-0000-0000-000004C75F6F Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1904 Lines: 44 Hello, Waiman On 2016年04月13日 23:53, Waiman Long wrote: > On 04/13/2016 07:15 AM, Pan Xinhui wrote: >> Hello Peter, >> >> On 2016年04月12日 22:30, Peter Zijlstra wrote: >> >>>> I am working on the qspinlock implementation on PPC. >>>> Your and Waiman's patches are so nice. :) >>> Thanks!, last time I looked at PPC spinlocks they could not use things >>> like ticket locks because PPC might be a guest and fairness blows etc.. >>> >>> You're making the qspinlock-paravirt thing work on PPC, or doing >>> qspinlock only for bare-metal PPC? >>> >> I am making the both work. :) >> qspinlock works on PPC now. I am preparing the patches and will send them out in next weeks :) > > What of performance improvement are you seeing in PPC? > well, not good. I wrote one small benchmark which just increase a integer with spinlock hold. the overhead of lock itself is high. But the fairness is good. I just do the tests in guestOS, and the qspinlock does not make use of paravirt, but spinlock does. So the performance gap now is a little big. looks like I need change the kernel config, and re-test. I does not measure the system impact in real world now. Let's see the kernel build times with two different locks. If possible, Could you share us how you do the performance test? >> The paravirt work is a little hard. >> currently, there are pv_wait() and pv_kick(). but only pv_kick has the parameter cpu(who will hold the lock as soon as the lock is unlocked). >> We need parameter cpu(who holds the lock now) in pv_wait,too. > > That can be doable to a certain extent. However, if the current lock holder acquired the lock via the fastpath only. The CPU information is not logged anywhere. For a contended lock, the information should be there. > yes. Maybe we could use hashtable. We could put lock, lock holder in pv_node, too. :) Just my thoughts. thanks xinhui > Cheers, > Longman >