Displaying 20 results from an estimated 32 matches for "virt_spin_lock_key".
2017 Sep 06
4
[PATCH v2 0/2] guard virt_spin_lock() with a static key
With virt_spin_lock() being guarded by a static key the bare metal case
can be optimized by patching the call away completely. In case a kernel
running as a guest it can decide whether to use paravitualized
spinlocks, the current fallback to the unfair test-and-set scheme, or
to mimic the bare metal behavior.
V2:
- use static key instead of making virt_spin_lock() a pvops function
Juergen Gross
2017 Sep 06
4
[PATCH v2 0/2] guard virt_spin_lock() with a static key
With virt_spin_lock() being guarded by a static key the bare metal case
can be optimized by patching the call away completely. In case a kernel
running as a guest it can decide whether to use paravitualized
spinlocks, the current fallback to the unfair test-and-set scheme, or
to mimic the bare metal behavior.
V2:
- use static key instead of making virt_spin_lock() a pvops function
Juergen Gross
2017 Oct 30
1
[locking/paravirt] static_key_disable_cpuslocked(): static key 'virt_spin_lock_key+0x0/0x20' used before call to jump_label_init()
...why you are reporting this for 4.14-rc6.
Ah sorry, I simply checked recent bisects for that warning.
Then I'll need to carry out some new bisect on 4.14-rc6.
>There is a patch by Dou Liyang pending since 28th October addressing
>that issue:
>
>[PATCH tip v2] x86/paravirt: Make the virt_spin_lock_key setup after
>jump_label_init()
Excellent!
Thanks,
Fengguang
2017 Oct 30
1
[locking/paravirt] static_key_disable_cpuslocked(): static key 'virt_spin_lock_key+0x0/0x20' used before call to jump_label_init()
...why you are reporting this for 4.14-rc6.
Ah sorry, I simply checked recent bisects for that warning.
Then I'll need to carry out some new bisect on 4.14-rc6.
>There is a patch by Dou Liyang pending since 28th October addressing
>that issue:
>
>[PATCH tip v2] x86/paravirt: Make the virt_spin_lock_key setup after
>jump_label_init()
Excellent!
Thanks,
Fengguang
2017 Oct 30
0
[locking/paravirt] static_key_disable_cpuslocked(): static key 'virt_spin_lock_key+0x0/0x20' used before call to jump_label_init()
.../jump_label.c:#static_key_disable_cpuslocked: 7
This patch is in the tip tree only, it will be merged in 4.15. So I
don't understand why you are reporting this for 4.14-rc6.
There is a patch by Dou Liyang pending since 28th October addressing
that issue:
[PATCH tip v2] x86/paravirt: Make the virt_spin_lock_key setup after
jump_label_init()
Juergen
>
> The call trace is
>
> [??? 0.000000] Booting paravirtualized kernel on bare hardware
> [??? 0.000000] clocksource: refined-jiffies: mask: 0xffffffff
> max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns
> [??? 0.000000] setup_...
2017 Sep 06
2
[PATCH v2 1/2] paravirt/locks: use new static key for controlling call of virt_spin_lock()
...gt;
> #include <asm/cpufeature.h>
> #include <asm-generic/qspinlock_types.h>
> #include <asm/paravirt.h>
> @@ -46,9 +47,15 @@ static inline void queued_spin_unlock(struct qspinlock *lock)
> #endif
>
> #ifdef CONFIG_PARAVIRT
> +DECLARE_STATIC_KEY_TRUE(virt_spin_lock_key);
> +
> +void native_pv_lock_init(void) __init;
> +
> #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_HY...
2017 Sep 06
2
[PATCH v2 1/2] paravirt/locks: use new static key for controlling call of virt_spin_lock()
...gt;
> #include <asm/cpufeature.h>
> #include <asm-generic/qspinlock_types.h>
> #include <asm/paravirt.h>
> @@ -46,9 +47,15 @@ static inline void queued_spin_unlock(struct qspinlock *lock)
> #endif
>
> #ifdef CONFIG_PARAVIRT
> +DECLARE_STATIC_KEY_TRUE(virt_spin_lock_key);
> +
> +void native_pv_lock_init(void) __init;
> +
> #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_HY...
2017 Sep 06
0
[PATCH v2 1/2] paravirt/locks: use new static key for controlling call of virt_spin_lock()
...CK_H
+#include <linux/jump_label.h>
#include <asm/cpufeature.h>
#include <asm-generic/qspinlock_types.h>
#include <asm/paravirt.h>
@@ -46,9 +47,15 @@ static inline void queued_spin_unlock(struct qspinlock *lock)
#endif
#ifdef CONFIG_PARAVIRT
+DECLARE_STATIC_KEY_TRUE(virt_spin_lock_key);
+
+void native_pv_lock_init(void) __init;
+
#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;
@@ -65,6 +72,10...
2017 Sep 06
5
[PATCH v3 0/2] guard virt_spin_lock() with a static key
With virt_spin_lock() being guarded by a static key the bare metal case
can be optimized by patching the call away completely. In case a kernel
running as a guest it can decide whether to use paravitualized
spinlocks, the current fallback to the unfair test-and-set scheme, or
to mimic the bare metal behavior.
V3:
- remove test for hypervisor environment from virt_spin_lock(9 as
suggested by
2017 Sep 06
5
[PATCH v3 0/2] guard virt_spin_lock() with a static key
With virt_spin_lock() being guarded by a static key the bare metal case
can be optimized by patching the call away completely. In case a kernel
running as a guest it can decide whether to use paravitualized
spinlocks, the current fallback to the unfair test-and-set scheme, or
to mimic the bare metal behavior.
V3:
- remove test for hypervisor environment from virt_spin_lock(9 as
suggested by
2017 Nov 01
2
[PATCH] x86/paravirt: Add kernel parameter to choose paravirt lock type
...pe = locktype_paravirt;
+ else if (!strcmp(s, "unfair"))
+ pv_spinlock_type = locktype_unfair;
+ else
+ return -EINVAL;
+
+ pr_info("PV lock type = %s (%d)\n", s, pv_spinlock_type);
+ return 0;
+}
+
+early_param("pvlock_type", pvlock_setup);
+
DEFINE_STATIC_KEY_TRUE(virt_spin_lock_key);
void __init native_pv_lock_init(void)
{
- if (!static_cpu_has(X86_FEATURE_HYPERVISOR))
+ if (pv_spinlock_type == locktype_unfair)
+ return;
+
+ if (!static_cpu_has(X86_FEATURE_HYPERVISOR) ||
+ (pv_spinlock_type != locktype_auto))
static_branch_disable(&virt_spin_lock_key);
}
@@...
2017 Nov 01
2
[PATCH] x86/paravirt: Add kernel parameter to choose paravirt lock type
...pe = locktype_paravirt;
+ else if (!strcmp(s, "unfair"))
+ pv_spinlock_type = locktype_unfair;
+ else
+ return -EINVAL;
+
+ pr_info("PV lock type = %s (%d)\n", s, pv_spinlock_type);
+ return 0;
+}
+
+early_param("pvlock_type", pvlock_setup);
+
DEFINE_STATIC_KEY_TRUE(virt_spin_lock_key);
void __init native_pv_lock_init(void)
{
- if (!static_cpu_has(X86_FEATURE_HYPERVISOR))
+ if (pv_spinlock_type == locktype_unfair)
+ return;
+
+ if (!static_cpu_has(X86_FEATURE_HYPERVISOR) ||
+ (pv_spinlock_type != locktype_auto))
static_branch_disable(&virt_spin_lock_key);
}
@@...
2017 Nov 01
3
[PATCH-tip v2 0/2] x86/paravirt: Enable users to choose PV lock type
v1->v2:
- Make pv_spinlock_type a bit mask for easier checking.
- Add patch 2 to deprecate xen_nopvspin
v1 - https://lkml.org/lkml/2017/11/1/381
Patch 1 adds a new pvlock_type parameter for the administrators to
specify the type of lock to be used in a para-virtualized kernel.
Patch 2 deprecates Xen's xen_nopvspin parameter as it is no longer
needed.
Waiman Long (2):
x86/paravirt:
2017 Nov 01
3
[PATCH-tip v2 0/2] x86/paravirt: Enable users to choose PV lock type
v1->v2:
- Make pv_spinlock_type a bit mask for easier checking.
- Add patch 2 to deprecate xen_nopvspin
v1 - https://lkml.org/lkml/2017/11/1/381
Patch 1 adds a new pvlock_type parameter for the administrators to
specify the type of lock to be used in a para-virtualized kernel.
Patch 2 deprecates Xen's xen_nopvspin parameter as it is no longer
needed.
Waiman Long (2):
x86/paravirt:
2017 Sep 06
0
[PATCH v2 2/2] paravirt,xen: correct xen_nopvspin case
...parameter "xen_nopvspin" specified a Xen guest should not
make use of paravirt spinlocks, but behave as if running on bare
metal. This is not true, however, as the qspinlock code will fall back
to a test-and-set scheme when it is detecting a hypervisor.
In order to avoid this disable the virt_spin_lock_key.
Signed-off-by: Juergen Gross <jgross at suse.com>
---
arch/x86/xen/spinlock.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c
index 25a7c4302ce7..e8ab80ad7a6f 100644
--- a/arch/x86/xen/spinlock.c
+++ b/arch/x86/xen/spinlock.c
@@ -10,6...
2017 Sep 06
1
[PATCH v2 1/2] paravirt/locks: use new static key for controlling call of virt_spin_lock()
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 s...
2017 Sep 06
1
[PATCH v2 1/2] paravirt/locks: use new static key for controlling call of virt_spin_lock()
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 s...
2017 Nov 01
0
[PATCH] x86/paravirt: Add kernel parameter to choose paravirt lock type
...air"))
> + pv_spinlock_type = locktype_unfair;
> + else
> + return -EINVAL;
> +
> + pr_info("PV lock type = %s (%d)\n", s, pv_spinlock_type);
> + return 0;
> +}
> +
> +early_param("pvlock_type", pvlock_setup);
> +
> DEFINE_STATIC_KEY_TRUE(virt_spin_lock_key);
>
> void __init native_pv_lock_init(void)
> {
> - if (!static_cpu_has(X86_FEATURE_HYPERVISOR))
> + if (pv_spinlock_type == locktype_unfair)
> + return;
> +
> + if (!static_cpu_has(X86_FEATURE_HYPERVISOR) ||
> + (pv_spinlock_type != locktype_auto))
> static...
2017 Nov 01
2
[PATCH] x86/paravirt: Add kernel parameter to choose paravirt lock type
...Xen's xen_nopvspin in term of disabling unfair lock.
> Hmm, I'm not sure we need pvlock_type _and_ xen_nopvspin. What do others
> think?
I don't think we need xen_nopvspin, but I don't want to remove that
without agreement from the community.
>> DEFINE_STATIC_KEY_TRUE(virt_spin_lock_key);
>>
>> void __init native_pv_lock_init(void)
>> {
>> - if (!static_cpu_has(X86_FEATURE_HYPERVISOR))
>> + if (pv_spinlock_type == locktype_unfair)
>> + return;
>> +
>> + if (!static_cpu_has(X86_FEATURE_HYPERVISOR) ||
>> + (pv_spinlock_ty...
2017 Nov 01
2
[PATCH] x86/paravirt: Add kernel parameter to choose paravirt lock type
...Xen's xen_nopvspin in term of disabling unfair lock.
> Hmm, I'm not sure we need pvlock_type _and_ xen_nopvspin. What do others
> think?
I don't think we need xen_nopvspin, but I don't want to remove that
without agreement from the community.
>> DEFINE_STATIC_KEY_TRUE(virt_spin_lock_key);
>>
>> void __init native_pv_lock_init(void)
>> {
>> - if (!static_cpu_has(X86_FEATURE_HYPERVISOR))
>> + if (pv_spinlock_type == locktype_unfair)
>> + return;
>> +
>> + if (!static_cpu_has(X86_FEATURE_HYPERVISOR) ||
>> + (pv_spinlock_ty...