From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juergen Gross Subject: Re: [PATCH v2 1/2] paravirt/locks: use new static key for controlling call of virt_spin_lock() Date: Wed, 6 Sep 2017 19:33:10 +0200 Message-ID: <6db11611-3b41-47fe-ec4c-75b1decbc83c@suse.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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <73d39808-ad47-6d06-89be-034181099408@redhat.com> Content-Language: de-DE List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Waiman Long , Peter Zijlstra Cc: jeremy@goop.org, x86@kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, chrisw@sous-sol.org, mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, xen-devel@lists.xenproject.org, akataria@vmware.com, boris.ostrovsky@oracle.com List-Id: virtualization@lists.linuxfoundation.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