Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754910AbaBSTtE (ORCPT ); Wed, 19 Feb 2014 14:49:04 -0500 Received: from merlin.infradead.org ([205.233.59.134]:40496 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754486AbaBSTtC (ORCPT ); Wed, 19 Feb 2014 14:49:02 -0500 Date: Wed, 19 Feb 2014 20:48:32 +0100 From: Peter Zijlstra To: Waiman Long Cc: "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 , Raghavendra K T , George Spelvin , Tim Chen , Daniel J Blueman , Alexander Fyodorov , Aswin Chandramouleeswaran , Scott J Norton , Thavatchai Makphaibulchoke Subject: Re: [PATCH v4 0/3] qspinlock: Introducing a 4-byte queue spinlock Message-ID: <20140219194832.GY14089@laptop.programming.kicks-ass.net> 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> <20140219085107.GG27965@twins.programming.kicks-ass.net> <53050501.3070101@hp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53050501.3070101@hp.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 Wed, Feb 19, 2014 at 02:24:49PM -0500, Waiman Long wrote: > On 02/19/2014 03:51 AM, Peter Zijlstra wrote: > >On Tue, Feb 18, 2014 at 07:42:20PM -0500, 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. > >No it very much should; how else is paravirt ever going to work? > > We do have a CONFIG_PARAVIRT macro that turns on or off PV support. The > queue spinlock can be easily changed into an unfair lock which allows lock > stealing. We could have a config option to make it unfair in the PARAVIRT > environment, but I don't think Linus like the idea of an unfair lock. No; a guest is very much aware of paravirt. See for example the static_key_false(¶virt_ticketlocks_enabled). It would be impossible to set that branch if you never knew you were a guest. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/