From mboxrd@z Thu Jan 1 00:00:00 1970 From: Waiman Long Subject: Re: [PATCH v6 05/11] pvqspinlock, x86: Allow unfair spinlock in a PV guest Date: Wed, 19 Mar 2014 12:58:18 -0400 Message-ID: <5329CCAA.9000909@hp.com> References: <1394650498-30118-1-git-send-email-Waiman.Long@hp.com> <1394650498-30118-6-git-send-email-Waiman.Long@hp.com> <53218E7A.8090707@citrix.com> <5321AF96.6070909@redhat.com> <20140317190511.GB11707@phenom.dumpdata.com> <53280075.1020804@redhat.com> <53290BCD.8010001@hp.com> <53296C6F.7040709@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from g2t2353.austin.hp.com ([15.217.128.52]:39771 "EHLO g2t2353.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933682AbaCSQ7t (ORCPT ); Wed, 19 Mar 2014 12:59:49 -0400 In-Reply-To: <53296C6F.7040709@redhat.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Paolo Bonzini Cc: Konrad Rzeszutek Wilk , Jeremy Fitzhardinge , Raghavendra K T , Gleb Natapov , Peter Zijlstra , virtualization@lists.linux-foundation.org, Andi Kleen , "H. Peter Anvin" , Michel Lespinasse , Alok Kataria , linux-arch@vger.kernel.org, kvm@vger.kernel.org, x86@kernel.org, Ingo Molnar , xen-devel@lists.xenproject.org, "Paul E. McKenney" , Rik van Riel , Arnd Bergmann , Scott J Norton , Steven Rostedt , Chris Wright , Thomas Gleixner , Aswin Chandramouleeswaran , Chegu Vinod On 03/19/2014 06:07 AM, Paolo Bonzini wrote: > Il 19/03/2014 04:15, Waiman Long ha scritto: >>>> You should see the same values with the PV ticketlock. It is not clear >>>> to me if this testing did include that variant of locks? >>> >>> Yes, PV is fine. But up to this point of the series, we are concerned >>> about spinlock performance when running on an overcommitted hypervisor >>> that doesn't support PV spinlocks. >> >> The unfair queue lock is designed in such a way that it will only be >> activated when running in a PV guest or it won't be mergeable upstream. >> So there must be some way to determine if it is running under a >> hypervisor. > > Exactly. What you want is boot_cpu_has(X86_FEATURE_HYPERVISOR). > > Paolo The unfair lock is to be enabled by boot time check, not just by the presence of a configuration macro during the build process in order to avoid using unfair lock on bare metal. Of course, Linux distros can modify this if that suits their need. -Longman