From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751814AbdIFRxp (ORCPT ); Wed, 6 Sep 2017 13:53:45 -0400 Received: from mx2.suse.de ([195.135.220.15]:56197 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750807AbdIFRxo (ORCPT ); Wed, 6 Sep 2017 13:53:44 -0400 Subject: Re: [PATCH v2 1/2] paravirt/locks: use new static key for controlling call of virt_spin_lock() To: Waiman Long , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org, virtualization@lists.linux-foundation.org, jeremy@goop.org, chrisw@sous-sol.org, akataria@vmware.com, rusty@rustcorp.com.au, boris.ostrovsky@oracle.com, hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com References: <20170906152928.8658-1-jgross@suse.com> <20170906152928.8658-2-jgross@suse.com> <20170906160415.crt2ajuf6553bit7@hirez.programming.kicks-ass.net> <73d39808-ad47-6d06-89be-034181099408@redhat.com> From: Juergen Gross Message-ID: <6db11611-3b41-47fe-ec4c-75b1decbc83c@suse.com> Date: Wed, 6 Sep 2017 19:33:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <73d39808-ad47-6d06-89be-034181099408@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/09/17 18:13, Waiman Long wrote: > On 09/06/2017 12:04 PM, Peter Zijlstra wrote: >> On Wed, Sep 06, 2017 at 11:49:49AM -0400, Waiman Long wrote: >>>> #define virt_spin_lock virt_spin_lock >>>> static inline bool virt_spin_lock(struct qspinlock *lock) >>>> { >>>> + if (!static_branch_likely(&virt_spin_lock_key)) >>>> + return false; >>>> if (!static_cpu_has(X86_FEATURE_HYPERVISOR)) >>>> return false; >>>> >> Now native has two NOPs instead of one. Can't we merge these two static >> branches? > > > I guess we can remove the static_cpu_has() call. Just that any spin_lock > calls before native_pv_lock_init() will use the virt_spin_lock(). That > is still OK as the init call is done before SMP starts. Hmm, right. I'll send V3 in some minutes. Juergen