Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754482AbcDNIlX (ORCPT ); Thu, 14 Apr 2016 04:41:23 -0400 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:60630 "EHLO e23smtp03.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754458AbcDNIlP (ORCPT ); Thu, 14 Apr 2016 04:41:15 -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: <570F575C.8010400@linux.vnet.ibm.com> Date: Thu, 14 Apr 2016 16:39:56 +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: Peter Zijlstra , Waiman Long CC: Ingo Molnar , linux-kernel@vger.kernel.org, Scott J Norton , Douglas Hatch Subject: Re: [PATCH] locking/pvqspinlock: Add lock holder CPU argument to pv_wait() References: <1460581160-46187-1-git-send-email-Waiman.Long@hpe.com> <20160414002135.GP2906@worktop> In-Reply-To: <20160414002135.GP2906@worktop> 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-0009-0000-0000-000006DA04FF Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 994 Lines: 20 On 2016年04月14日 08:21, Peter Zijlstra wrote: > On Wed, Apr 13, 2016 at 04:59:20PM -0400, Waiman Long wrote: >> Pan Xinhui was asking for a lock holder cpu argument in pv_wait() >> to help the porting of pvqspinlock to PPC. The new argument will can >> potentially help hypervisor expediate the execution of the critical >> section so that the lock holder vCPU can release the lock sooner. >> >> This patch does just that by storing the previous node vCPU number. >> In pv_wait_head_or_lock(), pv_wait() will be called with that vCPU >> number as it is likely to be the lock holder. In pv_wait_node(), >> -1 will be passed to pv_wait() instead to indicate that it doesn't >> know what the current lock holder is. > > Without knowing why he needs this, it is very hard to tell if this will > suffice. > > Xinhui, what do you need the extra argument for? > We the could give current vcpu's slice to that vcpu. The lock holder has more slice to run, the lock might be unlocked earlier. :)