From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751532AbdIEIHg (ORCPT ); Tue, 5 Sep 2017 04:07:36 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:54153 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751330AbdIEIHc (ORCPT ); Tue, 5 Sep 2017 04:07:32 -0400 Date: Tue, 5 Sep 2017 10:07:26 +0200 From: Peter Zijlstra To: Oscar Salvador Cc: Juergen Gross , Davidlohr Bueso , Ingo Molnar , Paolo Bonzini , "H . Peter Anvin" , Thomas Gleixner , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, Waiman Long Subject: Re: [PATCH resend] x86,kvm: Add a kernel parameter to disable PV spinlock Message-ID: <20170905080726.7qp752syjo7u5nmz@hirez.programming.kicks-ass.net> References: <20170904142836.15446-1-osalvador@suse.de> <20170904144011.gp7hpis6usjehbuf@hirez.programming.kicks-ass.net> <20170904222157.GD17982@linux-80c1.suse> <0869e8a5-4abd-8f7f-0135-aab3e72e2d01@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 05, 2017 at 08:57:16AM +0200, Oscar Salvador wrote: > It may be that the original patch was just to keep consistency between Xen > and KVM, and also only for testing purposes. > But we find a case when a customer of ours is running some workloads with > 1<->1 mapping between physical cores and virtual cores, and we realized that > with the pv spinlocks disabled there is a 4-5% of performance gain. There are very definite downsides to using a test-and-set spinlock. A much better option would be one that forces the use of native qspinlock in the 1:1 case. That means you have to fail both pv_enabled() and virt_spin_lock().