From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753416AbbIPPIe (ORCPT ); Wed, 16 Sep 2015 11:08:34 -0400 Received: from casper.infradead.org ([85.118.1.10]:53531 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753325AbbIPPIc (ORCPT ); Wed, 16 Sep 2015 11:08:32 -0400 Date: Wed, 16 Sep 2015 17:03:07 +0200 From: Peter Zijlstra To: Waiman Long 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 Message-ID: <20150916150307.GD3604@twins.programming.kicks-ass.net> 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> <55F839FE.9030403@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55F839FE.9030403@hpe.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 15, 2015 at 11:32:14AM -0400, Waiman Long wrote: > 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. Ah, yes I see, we do not have storage for the lock holder. Yes you're right.