search for: locktype_auto

Displaying 10 results from an estimated 10 matches for "locktype_auto".

2017 Nov 01
2
[PATCH] x86/paravirt: Add kernel parameter to choose paravirt lock type
...b/arch/x86/include/asm/paravirt.h index 12deec7..941a046 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/x8...
2017 Nov 01
2
[PATCH] x86/paravirt: Add kernel parameter to choose paravirt lock type
...b/arch/x86/include/asm/paravirt.h index 12deec7..941a046 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/x8...
2017 Nov 01
2
[PATCH-tip v2 2/2] x86/xen: Deprecate xen_nopvspin
...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 value or a pattern would be better, especially since none of the uses is on a critical path. (For example, !pv_spinlock_type is the same as locktype_auto, which is defined but never used) -boris > return 0; > } > early_param("xen_nopvspin", xen_parse_nopvspin); > -
2017 Nov 01
2
[PATCH-tip v2 2/2] x86/xen: Deprecate xen_nopvspin
...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 value or a pattern would be better, especially since none of the uses is on a critical path. (For example, !pv_spinlock_type is the same as locktype_auto, which is defined but never used) -boris > return 0; > } > early_param("xen_nopvspin", xen_parse_nopvspin); > -
2017 Nov 01
0
[PATCH] x86/paravirt: Add kernel parameter to choose paravirt lock type
...12deec7..941a046 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;&...
2017 Nov 02
0
[PATCH-tip v2 2/2] x86/xen: Deprecate xen_nopvspin
...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 value or a pattern would be better, especially > since none of the uses is on a critical path. > > (For example, !pv_spinlock_type is the same as locktype_auto, which is > defined but never used) OK, I will take out the enum and make explicit use of locktype_auto. Cheers, Longman
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
2
[PATCH] x86/paravirt: Add kernel parameter to choose paravirt lock type
...;> >> 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 spinlock, it doesn't matter if the static key is disabled or not. Without CONFIG_PARAVIRT_SPINLOCKS, however, it does degenerate into the...
2017 Nov 01
2
[PATCH] x86/paravirt: Add kernel parameter to choose paravirt lock type
...;> >> 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 spinlock, it doesn't matter if the static key is disabled or not. Without CONFIG_PARAVIRT_SPINLOCKS, however, it does degenerate into the...