From: Waiman Long Subject: Re: [PATCH] x86/kvm: Don't use pvqspinlock code if only 1 vCPU Date: Thu, 19 Jul 2018 09:34:58 -0400 Message-ID: <24e1962a-075c-8168-5d95-033b826ee919@redhat.com> References: <1531864767-30648-1-git-send-email-longman@redhat.com> <20180719011546.GB28585@char.US.ORACLE.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Joe Mario To: Konrad Rzeszutek Wilk Return-path: In-Reply-To: <20180719011546.GB28585@char.US.ORACLE.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 07/18/2018 09:15 PM, Konrad Rzeszutek Wilk wrote: > On Tue, Jul 17, 2018 at 05:59:27PM -0400, Waiman Long wrote: >> On a VM with only 1 vCPU, the locking fast path will always be >> successful. In this case, there is no need to use the the PV qspinlock >> code which has higher overhead on the unlock side than the native >> qspinlock code. > Why not make this global? That is for both KVM and Xen and any > other virtualized guest that uses this? Right, I will send another patch for Xen. The pvqspinlock code has to be explicitly opted in. Right now, both Xen and KVM used it in the tree. I am not sure about other out-of-tree modules. There is nothing I can do for those. Cheers, Longman