From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754126AbbIOPc0 (ORCPT ); Tue, 15 Sep 2015 11:32:26 -0400 Received: from g2t4620.austin.hp.com ([15.73.212.81]:41750 "EHLO g2t4620.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754061AbbIOPcQ (ORCPT ); Tue, 15 Sep 2015 11:32:16 -0400 Message-ID: <55F839FE.9030403@hpe.com> Date: Tue, 15 Sep 2015 11:32:14 -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 , Thomas Gleixner , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, Scott J Norton , Douglas Hatch , Davidlohr Bueso Subject: Re: [PATCH v6 6/6] locking/pvqspinlock: Queue node adaptive spinning References: <1441996658-62854-1-git-send-email-Waiman.Long@hpe.com> <1441996658-62854-7-git-send-email-Waiman.Long@hpe.com> <20150914141012.GV18489@twins.programming.kicks-ass.net> <55F721FC.4000504@hpe.com> <20150915083804.GY16853@twins.programming.kicks-ass.net> In-Reply-To: <20150915083804.GY16853@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/15/2015 04:38 AM, Peter Zijlstra wrote: > On Mon, Sep 14, 2015 at 03:37:32PM -0400, Waiman Long wrote: >> BTW, the queue head vCPU at pv_wait_head_and_lock() doesn't wait early, it >> will spin the full threshold as there is no way for it to figure out if the >> lock holder is running or not. > We can know its cpu id, right? Surely we should then be able to figure > out if its active or not, I'm thinking the KVM/Xen know these things > somewhere. We can make a guess of the lock holder cpu id by peeking at previous MCS node. However, if the current lock holder got the lock without entering the queue or it got the lock by stealing, we won't have information of what CPU it is. Cheers, Longman