From mboxrd@z Thu Jan 1 00:00:00 1970 From: Raghavendra K T Subject: Re: [PATCH v4 0/3] qspinlock: Introducing a 4-byte queue spinlock Date: Wed, 19 Feb 2014 12:39:29 +0530 Message-ID: <530458A9.1090603@linux.vnet.ibm.com> References: <1392669684-4807-1-git-send-email-Waiman.Long@hp.com> <53029167.4060109@zytor.com> <20140218073111.GW27965@twins.programming.kicks-ass.net> <5303B4C4.2040907@hp.com> <20140218212827.GR14089@laptop.programming.kicks-ass.net> <5303FDEC.9060001@hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from e23smtp01.au.ibm.com ([202.81.31.143]:55971 "EHLO e23smtp01.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751029AbaBSHDh (ORCPT ); Wed, 19 Feb 2014 02:03:37 -0500 Received: from /spool/local by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 19 Feb 2014 17:03:35 +1000 In-Reply-To: <5303FDEC.9060001@hp.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Waiman Long Cc: Peter Zijlstra , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Arnd Bergmann , linux-arch@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Steven Rostedt , Andrew Morton , Michel Lespinasse , Andi Kleen , Rik van Riel , "Paul E. McKenney" , Linus Torvalds , George Spelvin , Tim Chen , Daniel J Blueman , Alexander Fyodorov , Aswin Chandramouleeswaran , Scott J Norton , Thavatchai Makphaibulchoke On 02/19/2014 06:12 AM, Waiman Long wrote: > On 02/18/2014 04:28 PM, Peter Zijlstra wrote: >> On Tue, Feb 18, 2014 at 02:30:12PM -0500, Waiman Long wrote: >>> I will start looking at how to make it work with paravirt. Hopefully, it >>> won't take too long. >> The cheap way out is to simply switch to the test-and-set spinlock on >> whatever X86_FEATURE_ indicates a guest I suppose. > > I don't think there is X86_FEATURE flag that indicates running in a > guest. In fact, a guest should never find out if it is running virtualized. > > After reading the current PV ticketlock implementation, I have a rough > idea of what I need to do to implement PV support in qspinlock. A large > portion of PV ticketlock code is find out the CPU number of the next one > to get the lock. The current qspinlock implementation has already > included CPU number of the previous member in the queue and it should be > pretty easy to store CPU number of the next one in the queue node > structure. These CPU numbers can then be supplied to the kick_cpu() > function to schedule in the require the CPU to make sure that progress > can be made. That is correct. Strict serialization of the lock is usually a headache for virtualized guest (especially when overcommitted). I am eager to test the next version.