Displaying 11 results from an estimated 11 matches for "locktype_unfair".
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 Nov 01
0
[PATCH-tip v2 2/2] x86/xen: Deprecate xen_nopvspin
...DEFINE_PER_CPU(int, lock_kicker_irq) = -1;
static DEFINE_PER_CPU(char *, irq_name);
-static bool xen_pvspin = true;
#include <asm/qspinlock.h>
@@ -81,12 +80,8 @@ void xen_init_lock_cpu(int cpu)
int irq;
char *name;
- if (!xen_pvspin ||
- (pv_spinlock_type & (locktype_queued|locktype_unfair))) {
- if ((cpu == 0) && !pv_spinlock_type)
- static_branch_disable(&virt_spin_lock_key);
+ if (pv_spinlock_type & (locktype_queued|locktype_unfair))
return;
- }
WARN(per_cpu(lock_kicker_irq, cpu) >= 0, "spinlock on CPU%d exists on IRQ%d!\n",
cpu, per_c...
2017 Nov 01
2
[PATCH] x86/paravirt: Add kernel parameter to choose paravirt lock type
...100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -690,6 +690,15 @@ static __always_inline bool pv_vcpu_is_preempted(long cpu)
#endif /* SMP && PARAVIRT_SPINLOCKS */
+enum pv_spinlock_type {
+ locktype_auto,
+ locktype_queued,
+ locktype_paravirt,
+ locktype_unfair,
+};
+
+extern enum pv_spinlock_type pv_spinlock_type;
+
#ifdef CONFIG_X86_32
#define PV_SAVE_REGS "pushl %ecx; pushl %edx;"
#define PV_RESTORE_REGS "popl %edx; popl %ecx;"
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 8bb9594..3a5d3ec4 100644
--- a/arch/x8...
2017 Nov 01
2
[PATCH] x86/paravirt: Add kernel parameter to choose paravirt lock type
...100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -690,6 +690,15 @@ static __always_inline bool pv_vcpu_is_preempted(long cpu)
#endif /* SMP && PARAVIRT_SPINLOCKS */
+enum pv_spinlock_type {
+ locktype_auto,
+ locktype_queued,
+ locktype_paravirt,
+ locktype_unfair,
+};
+
+extern enum pv_spinlock_type pv_spinlock_type;
+
#ifdef CONFIG_X86_32
#define PV_SAVE_REGS "pushl %ecx; pushl %edx;"
#define PV_RESTORE_REGS "popl %edx; popl %ecx;"
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 8bb9594..3a5d3ec4 100644
--- a/arch/x8...
2017 Nov 01
0
[PATCH] x86/paravirt: Add kernel parameter to choose paravirt lock type
...+++ b/arch/x86/include/asm/paravirt.h
> @@ -690,6 +690,15 @@ static __always_inline bool pv_vcpu_is_preempted(long cpu)
>
> #endif /* SMP && PARAVIRT_SPINLOCKS */
>
> +enum pv_spinlock_type {
> + locktype_auto,
> + locktype_queued,
> + locktype_paravirt,
> + locktype_unfair,
> +};
> +
> +extern enum pv_spinlock_type pv_spinlock_type;
> +
> #ifdef CONFIG_X86_32
> #define PV_SAVE_REGS "pushl %ecx; pushl %edx;"
> #define PV_RESTORE_REGS "popl %edx; popl %ecx;"
> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
>...
2017 Nov 01
2
[PATCH-tip v2 2/2] x86/xen: Deprecate xen_nopvspin
...nopvspin is deprecated, replace it with \"pvlock_type=queued\"!\n");
> + if (!pv_spinlock_type)
> + pv_spinlock_type = locktype_queued;
Since we currently end up using unfair locks and because you are
deprecating xen_nopvspin I wonder whether it would be better to set this
to locktype_unfair so that current behavior doesn't change. (Sorry, I
haven't responded to your earlier message before you posted this). Juergen?
I am also not sure I agree with making pv_spinlock an enum *and* a
bitmask at the same time. I understand that it makes checks easier but I
think not assuming a va...
2017 Nov 01
2
[PATCH-tip v2 2/2] x86/xen: Deprecate xen_nopvspin
...nopvspin is deprecated, replace it with \"pvlock_type=queued\"!\n");
> + if (!pv_spinlock_type)
> + pv_spinlock_type = locktype_queued;
Since we currently end up using unfair locks and because you are
deprecating xen_nopvspin I wonder whether it would be better to set this
to locktype_unfair so that current behavior doesn't change. (Sorry, I
haven't responded to your earlier message before you posted this). Juergen?
I am also not sure I agree with making pv_spinlock an enum *and* a
bitmask at the same time. I understand that it makes checks easier but I
think not assuming a va...
2017 Nov 02
0
[PATCH-tip v2 2/2] x86/xen: Deprecate xen_nopvspin
..., replace it with \"pvlock_type=queued\"!\n");
>> + if (!pv_spinlock_type)
>> + pv_spinlock_type = locktype_queued;
> Since we currently end up using unfair locks and because you are
> deprecating xen_nopvspin I wonder whether it would be better to set this
> to locktype_unfair so that current behavior doesn't change. (Sorry, I
> haven't responded to your earlier message before you posted this). Juergen?
I think the latest patch from Juergen in tip is to use native qspinlock
when xen_nopvspin is specified. Right? That is why I made the current
choice. I can ce...
2017 Nov 01
2
[PATCH] x86/paravirt: Add kernel parameter to choose paravirt lock type
...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_type != locktype_auto))
>> static_branch_disable(&virt_spin_lock_key);
> Really? I don't think locktype_paravirt should disable the static key.
With paravirt spi...
2017 Nov 01
2
[PATCH] x86/paravirt: Add kernel parameter to choose paravirt lock type
...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_type != locktype_auto))
>> static_branch_disable(&virt_spin_lock_key);
> Really? I don't think locktype_paravirt should disable the static key.
With paravirt spi...