Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752861AbcDNB7f (ORCPT ); Wed, 13 Apr 2016 21:59:35 -0400 Received: from mail-bn1on0146.outbound.protection.outlook.com ([157.56.110.146]:56320 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751015AbcDNB7d (ORCPT ); Wed, 13 Apr 2016 21:59:33 -0400 Authentication-Results: infradead.org; dkim=none (message not signed) header.d=none;infradead.org; dmarc=none action=none header.from=hpe.com; Message-ID: <570EF973.4000402@hpe.com> Date: Wed, 13 Apr 2016 21:59:15 -0400 From: Waiman Long User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130109 Thunderbird/10.0.12 MIME-Version: 1.0 To: Peter Zijlstra CC: Ingo Molnar , , Pan Xinhui , 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="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [72.71.243.105] X-ClientProxiedBy: BLUPR0301CA0019.namprd03.prod.outlook.com (10.162.113.157) To CS1PR84MB0312.NAMPRD84.PROD.OUTLOOK.COM (10.162.190.30) X-MS-Office365-Filtering-Correlation-Id: bff59b3b-535e-47ec-5821-08d364086a91 X-Microsoft-Exchange-Diagnostics: 1;CS1PR84MB0312;2:u5nyemS9nO33mr2lVWjyQVMx0dgksCKnja+lmbzKKoC1LHOPyrPwDmksHLfuTtuomuln5SNc/x0jw+i85edR6YQNXicoZlXCdIrarYEohg3ydZuSfcQ6+v7HeRoH30Ex8Wuboum0thXaidgpfafRKZ+/oabDpLP7oa85a7lKHuxde+9SZtw/K0EpU/nuWT7U;3:m1M6QoHExlNk0cw/HoSfgGm3IsRLG1cC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hU+slHy46dDTbsZZunVYTcyaMRtHQCbpAJ+PSJlbKHj9SdvwL1v6elHLyfEjJaaahedIZRm+q6voVwsw/loYRTVLRHiFj9PE4n4PkoVuvxZCPC0TQo0ZrPlXXYUhacArzx3abPHvBmK93V3lL86H+u/JXN1N9IZBw==;4:ki5AgYMyXn+bmb7LXJAfKEyPufXCRtURRITZWljOXMOGDz1lW5d2teWY2WGGsZL2UD8ZFbv+b/ML1k23eNjDbvwMu7/JQOk4PfCyn23honN1rfla9eEQEOxmneCiLfDyQYH4KdNIpkvLAJu432prOt5293lriU25evFUJtdw2LpXp/3lPVZMDOavpvkSmmGf+lYx+OxU9sa09GrXjlnH3f12ejBentt+8kshaTdSdRvpoACxFQdHiOuBrmdgzqb+JUi3a/WZNArYM4GKUNEQ14YDdCOWgJX5Q3bTmEVXiNy1tWrvzfsepVkPdXfZy7CYz1jt2SvY4aP//MaWn7nLGEV3DwGArNdGIE1YpizfolmMUZufR0X0bK1utkIk2Vek X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:CS1PR84MB0312;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0312; X-Forefront-PRVS: 0912297777 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(6049001)(24454002)(377454003)(2906002)(5008740100001)(81166005)(59896002)(64126003)(117156001)(66066001)(23756003)(230700001)(5004730100002)(47776003)(50466002)(189998001)(586003)(3846002)(1096002)(110136002)(77096005)(87266999)(86362001)(54356999)(6116002)(50986999)(80316001)(4326007)(4001350100001)(42186005)(76176999)(92566002)(2950100001)(36756003)(33656002);DIR:OUT;SFP:1102;SCL:1;SRVR:CS1PR84MB0312;H:[192.168.142.156];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?iso-8859-1?Q?1;CS1PR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?= =?iso-8859-1?Q?aNKR3xoCyKMXgPLypTBXCLWcmHfX1vhrwQPXHOLrPUw1jnIvgvwvEezVIB?= =?iso-8859-1?Q?chxXC4s/Z//xVuWg6koJHDeU3zG+/mbXOsNaay1f62Y8A4flNxPd1q0kL8?= =?iso-8859-1?Q?TMek/AAA4ix+QpUYbMLY9ebyJRDqQhmvQs2k=3D?= X-Microsoft-Exchange-Diagnostics: 1;CS1PR84MB0312;5:UZV/W1t/alhn3qbodNpYSmNDaDqJKdRRNSz6+E77HtNwIhkIV3PdxzaoxwGCGWBY2nSloKY+0IHGXf54uua+4b9vymKXuJaFOsBhBg4ynrB1J3Y9UBHQWd9tSxpEIH/2jfEnFjtZs8Cur91O+VTtgQ==;24:XwMgf9Ot2J7JBs1oHdtsEj0Whhrgj63HgHPd8PnPIN8yFolAKwPqLPx2nv5vjnXgQyNgZoRRY3llRfoU6GJ6OoY3p5J//dopXNPZxqcGwQ8= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2016 01:59:29.3235 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR84MB0312 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1132 Lines: 24 On 04/13/2016 08:21 PM, 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? I have some other people asking me if pvqspinlock was able to pass in information about which CPU was the lock holder before as he cited the PPC code has this capability to somehow kick up the vCPU that has the lock. That can be potentially useful in x86 too. Cheers, Longman