search for: static_key

Displaying 20 results from an estimated 148 matches for "static_key".

2014 Jun 15
0
[PATCH 09/11] pvqspinlock, x86: Rename paravirt_ticketlocks_enabled
.../spinlock.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) --- a/arch/x86/include/asm/spinlock.h +++ b/arch/x86/include/asm/spinlock.h @@ -39,7 +39,7 @@ /* How long a lock should spin before we consider blocking */ #define SPIN_THRESHOLD (1 << 15) -extern struct static_key paravirt_ticketlocks_enabled; +extern struct static_key paravirt_spinlocks_enabled; static __always_inline bool static_key_false(struct static_key *key); #ifdef CONFIG_QUEUE_SPINLOCK @@ -150,7 +150,7 @@ static inline void __ticket_unlock_slowp static __always_inline void arch_spin_unlock(arch_...
2015 Jan 20
0
[PATCH v14 08/11] qspinlock, x86: Rename paravirt_ticketlocks_enabled
...nclude/asm/spinlock.h b/arch/x86/include/asm/spinlock.h index 5a5b90c..de9ecbe 100644 --- a/arch/x86/include/asm/spinlock.h +++ b/arch/x86/include/asm/spinlock.h @@ -39,7 +39,7 @@ /* How long a lock should spin before we consider blocking */ #define SPIN_THRESHOLD (1 << 15) -extern struct static_key paravirt_ticketlocks_enabled; +extern struct static_key paravirt_spinlocks_enabled; static __always_inline bool static_key_false(struct static_key *key); #ifdef CONFIG_QUEUE_SPINLOCK @@ -150,7 +150,7 @@ static inline void __ticket_unlock_slowpath(arch_spinlock_t *lock, static __always_inline v...
2015 Jan 20
0
[PATCH v14 08/11] qspinlock, x86: Rename paravirt_ticketlocks_enabled
...nclude/asm/spinlock.h b/arch/x86/include/asm/spinlock.h index 5a5b90c..de9ecbe 100644 --- a/arch/x86/include/asm/spinlock.h +++ b/arch/x86/include/asm/spinlock.h @@ -39,7 +39,7 @@ /* How long a lock should spin before we consider blocking */ #define SPIN_THRESHOLD (1 << 15) -extern struct static_key paravirt_ticketlocks_enabled; +extern struct static_key paravirt_spinlocks_enabled; static __always_inline bool static_key_false(struct static_key *key); #ifdef CONFIG_QUEUE_SPINLOCK @@ -150,7 +150,7 @@ static inline void __ticket_unlock_slowpath(arch_spinlock_t *lock, static __always_inline v...
2017 Jan 12
1
[PATCH] x86, locking/spinlocks: Remove paravirt_ticketlocks_enabled
This is a follow-up of commit cfd8983f03c7b2 ("x86, locking/spinlocks: Remove ticket (spin)lock implementation"). The static_key structure paravirt_ticketlocks_enabled is now removed as it is no longer used. A simple build and boot test was done to verify it. Signed-off-by: Waiman Long <longman at redhat.com> --- arch/x86/include/asm/spinlock.h | 3 --- arch/x86/kernel/kvm.c | 1 - arch/x86/kerne...
2017 Jan 12
1
[PATCH] x86, locking/spinlocks: Remove paravirt_ticketlocks_enabled
This is a follow-up of commit cfd8983f03c7b2 ("x86, locking/spinlocks: Remove ticket (spin)lock implementation"). The static_key structure paravirt_ticketlocks_enabled is now removed as it is no longer used. A simple build and boot test was done to verify it. Signed-off-by: Waiman Long <longman at redhat.com> --- arch/x86/include/asm/spinlock.h | 3 --- arch/x86/kernel/kvm.c | 1 - arch/x86/kerne...
2017 Jan 12
1
[PATCH v2] x86, locking/spinlocks: Remove paravirt_ticketlocks_enabled
This is a follow-up of commit cfd8983f03c7b2 ("x86, locking/spinlocks: Remove ticket (spin)lock implementation"). The static_key structure paravirt_ticketlocks_enabled is now removed as it is no longer used. As a result, the init functions kvm_spinlock_init_jump() and xen_init_spinlocks_jump() are also removed. A simple build and boot test was done to verify it. Signed-off-by: Waiman Long <longman at redhat.com> ---...
2017 Jan 12
1
[PATCH v2] x86, locking/spinlocks: Remove paravirt_ticketlocks_enabled
This is a follow-up of commit cfd8983f03c7b2 ("x86, locking/spinlocks: Remove ticket (spin)lock implementation"). The static_key structure paravirt_ticketlocks_enabled is now removed as it is no longer used. As a result, the init functions kvm_spinlock_init_jump() and xen_init_spinlocks_jump() are also removed. A simple build and boot test was done to verify it. Signed-off-by: Waiman Long <longman at redhat.com> ---...
2014 Feb 26
0
[PATCH RFC v5 4/8] pvqspinlock, x86: Allow unfair spinlock in a real PV environment
...urn 1; + return 0; +} + +/* + * Redefine arch_spin_lock and arch_spin_trylock as inline functions that will + * jump to the unfair versions if the static key paravirt_unfairlocks_enabled + * is true. + */ +#undef arch_spin_lock +#undef arch_spin_trylock +#undef arch_spin_lock_flags + +extern struct static_key paravirt_unfairlocks_enabled; + +/** + * arch_spin_lock - acquire a queue spinlock + * @lock: Pointer to queue spinlock structure + */ +static inline void arch_spin_lock(struct qspinlock *lock) +{ + if (static_key_false(&paravirt_unfairlocks_enabled)) { + queue_spin_lock_unfair(lock); + retur...
2012 Apr 19
13
[PATCH RFC V7 0/12] Paravirtualized ticketlocks
...ng paravirtualized spinlock mechanism with a paravirtualized ticketlock mechanism. (targeted for 3.5 window) Changes in V7: - Reabsed patches to 3.4-rc3 - Added jumplabel split patch (originally from Andrew Jones rebased to 3.4-rc3 - jumplabel changes from Ingo and Jason taken and now using static_key_* instead of static_branch. - using UNINLINE_SPIN_UNLOCK (which was splitted as per suggestion from Linus) - This patch series is rebased on debugfs patch (that sould be already in Xen/linux-next https://lkml.org/lkml/2012/3/23/51) Ticket locks have an inherent problem in a virtualized c...
2012 Apr 19
13
[PATCH RFC V7 0/12] Paravirtualized ticketlocks
...ng paravirtualized spinlock mechanism with a paravirtualized ticketlock mechanism. (targeted for 3.5 window) Changes in V7: - Reabsed patches to 3.4-rc3 - Added jumplabel split patch (originally from Andrew Jones rebased to 3.4-rc3 - jumplabel changes from Ingo and Jason taken and now using static_key_* instead of static_branch. - using UNINLINE_SPIN_UNLOCK (which was splitted as per suggestion from Linus) - This patch series is rebased on debugfs patch (that sould be already in Xen/linux-next https://lkml.org/lkml/2012/3/23/51) Ticket locks have an inherent problem in a virtualized c...
2019 Sep 26
2
An error of asm goto occured while compiling Linux kernel 5.3
Hi all, I encountered an error while compiling Linux kernel 5.3 to IR. My LLVM version is 9.0.0 release. This error said "invalid operand for inline asm constraint 'i'" in arch/x86/include/asm/jump_table.h. The source code is static __always_inline bool arch_static_branch(struct static_key *key, bool branch) { asm_volatile_goto("1:" ".byte " __stringify(STATIC_KEY_INIT_NOP) "\n\t" ".pushsection __jump_table, \"aw\" \n\t" _ASM_ALIGN "\n\t" ".long 1b - ., %l[l_yes] - . \n\t" _ASM_PTR "%c0 + %c1 - .\n\t" &q...
2014 Mar 12
0
[PATCH v6 05/11] pvqspinlock, x86: Allow unfair spinlock in a PV guest
...urn 1; + return 0; +} + +/* + * Redefine arch_spin_lock and arch_spin_trylock as inline functions that will + * jump to the unfair versions if the static key paravirt_unfairlocks_enabled + * is true. + */ +#undef arch_spin_lock +#undef arch_spin_trylock +#undef arch_spin_lock_flags + +extern struct static_key paravirt_unfairlocks_enabled; + +/** + * arch_spin_lock - acquire a queue spinlock + * @lock: Pointer to queue spinlock structure + */ +static inline void arch_spin_lock(struct qspinlock *lock) +{ + if (static_key_false(&paravirt_unfairlocks_enabled)) + queue_spin_lock_unfair(lock); + else +...
2013 Aug 06
16
[PATCH V12 0/14] Paravirtualized ticket spinlocks
...see that we could get little more improvements on top of that. Changes before V8: Ticketlock change history: Changes in V7: - Reabsed patches to 3.4-rc3 - Added jumplabel split patch (originally from Andrew Jones rebased to 3.4-rc3 - jumplabel changes from Ingo and Jason taken and now using static_key_* instead of static_branch. - using UNINLINE_SPIN_UNLOCK (which was splitted as per suggestion from Linus) - This patch series is rebased on debugfs patch (that sould be already in Xen/linux-next https://lkml.org/lkml/2012/3/23/51) Changes in V6 posting: (Raghavendra K T) - Rebased to l...
2013 Aug 06
16
[PATCH V12 0/14] Paravirtualized ticket spinlocks
...see that we could get little more improvements on top of that. Changes before V8: Ticketlock change history: Changes in V7: - Reabsed patches to 3.4-rc3 - Added jumplabel split patch (originally from Andrew Jones rebased to 3.4-rc3 - jumplabel changes from Ingo and Jason taken and now using static_key_* instead of static_branch. - using UNINLINE_SPIN_UNLOCK (which was splitted as per suggestion from Linus) - This patch series is rebased on debugfs patch (that sould be already in Xen/linux-next https://lkml.org/lkml/2012/3/23/51) Changes in V6 posting: (Raghavendra K T) - Rebased to l...
2013 Aug 06
16
[PATCH V12 0/14] Paravirtualized ticket spinlocks
...see that we could get little more improvements on top of that. Changes before V8: Ticketlock change history: Changes in V7: - Reabsed patches to 3.4-rc3 - Added jumplabel split patch (originally from Andrew Jones rebased to 3.4-rc3 - jumplabel changes from Ingo and Jason taken and now using static_key_* instead of static_branch. - using UNINLINE_SPIN_UNLOCK (which was splitted as per suggestion from Linus) - This patch series is rebased on debugfs patch (that sould be already in Xen/linux-next https://lkml.org/lkml/2012/3/23/51) Changes in V6 posting: (Raghavendra K T) - Rebased to l...
2018 Nov 02
1
[PATCH 0/2] i8253: Fix PIT shutdown quirk on Hyper-V
...t; So add a test for running on Hyper-V, and use that test to skip > setting the counter register when running on Hyper-V. > > This patch replaces a previously proposed patch with a different > approach. This new approach follows comments from Thomas Gleixner. Did you consider using a static_key instead? You could set it in ms_hyperv_init_platform(). This would enable you to support future Hyper-V versions which don't require avoiding to set the count to zero. Juergen
2016 Nov 02
0
[PATCH v7 06/11] x86, paravirt: Add interface to support kvm/xen vcpu preempted check
...t cpu); }; /* This contains all the paravirt structures: we get a convenient diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h index 921bea7..0526f59 100644 --- a/arch/x86/include/asm/spinlock.h +++ b/arch/x86/include/asm/spinlock.h @@ -26,6 +26,14 @@ extern struct static_key paravirt_ticketlocks_enabled; static __always_inline bool static_key_false(struct static_key *key); +#ifdef CONFIG_PARAVIRT_SPINLOCKS +#define vcpu_is_preempted vcpu_is_preempted +static inline bool vcpu_is_preempted(int cpu) +{ + return pv_lock_ops.vcpu_is_preempted(cpu); +} +#endif + #include...
2019 May 27
3
[RFC PATCH 5/6] x86/mm/tlb: Flush remote and local TLBs concurrently
...ed long addr); > > + /* > > + * flush_tlb_multi() is the preferred interface. When it is used, > > + * flush_tlb_others() should return false. > > This comment does not make sense. flush_tlb_others() return type is > void. I suspect that is an artifact from before the static_key; an attempt to make the pv interface less awkward. Something like the below would work for KVM I suspect, the others (Hyper-V and Xen are more 'interesting'). --- --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -580,7 +580,7 @@ static void __init kvm_apf_trap_init(voi static...
2019 May 27
3
[RFC PATCH 5/6] x86/mm/tlb: Flush remote and local TLBs concurrently
...ed long addr); > > + /* > > + * flush_tlb_multi() is the preferred interface. When it is used, > > + * flush_tlb_others() should return false. > > This comment does not make sense. flush_tlb_others() return type is > void. I suspect that is an artifact from before the static_key; an attempt to make the pv interface less awkward. Something like the below would work for KVM I suspect, the others (Hyper-V and Xen are more 'interesting'). --- --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -580,7 +580,7 @@ static void __init kvm_apf_trap_init(voi static...
2014 May 30
0
[PATCH v11 09/16] qspinlock, x86: Allow unfair spinlock in a virtual guest
...spinlock.h b/arch/x86/include/asm/qspinlock.h index e4a4f5d..448de8b 100644 --- a/arch/x86/include/asm/qspinlock.h +++ b/arch/x86/include/asm/qspinlock.h @@ -5,6 +5,10 @@ #if !defined(CONFIG_X86_OOSTORE) && !defined(CONFIG_X86_PPRO_FENCE) +#ifdef CONFIG_VIRT_UNFAIR_LOCKS +extern struct static_key virt_unfairlocks_enabled; +#endif + #define queue_spin_unlock queue_spin_unlock /** * queue_spin_unlock - release a queue spinlock @@ -26,4 +30,79 @@ static inline void queue_spin_unlock(struct qspinlock *lock) #include <asm-generic/qspinlock.h> +union arch_qspinlock { + atomic_t val...