[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6db11611-3b41-47fe-ec4c-75b1decbc83c@suse.com>
Date: Wed, 6 Sep 2017 19:33:10 +0200
From: Juergen Gross <jgross@...e.com>
To: Waiman Long <longman@...hat.com>,
Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org, xen-devel@...ts.xenproject.org,
x86@...nel.org, virtualization@...ts.linux-foundation.org,
jeremy@...p.org, chrisw@...s-sol.org, akataria@...are.com,
rusty@...tcorp.com.au, boris.ostrovsky@...cle.com, hpa@...or.com,
tglx@...utronix.de, mingo@...hat.com
Subject: Re: [PATCH v2 1/2] paravirt/locks: use new static key for controlling
call of virt_spin_lock()
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
Powered by blists - more mailing lists