提交 62c7a1e9 编写于 作者: I Ingo Molnar

locking/pvqspinlock: Rename QUEUED_SPINLOCK to QUEUED_SPINLOCKS

Valentin Rothberg reported that we use CONFIG_QUEUED_SPINLOCKS
in arch/x86/kernel/paravirt_patch_32.c, while the symbol is
called CONFIG_QUEUED_SPINLOCK. (Note the extra 'S')

But the typo was natural: the proper English term for such
a generic object would be 'queued spinlocks' - so rename
this and related symbols accordingly to the plural form.
Reported-by: NValentin Rothberg <valentinrothberg@gmail.com>
Cc: Douglas Hatch <doug.hatch@hp.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Scott J Norton <scott.norton@hp.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Waiman Long <Waiman.Long@hp.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: NIngo Molnar <mingo@kernel.org>
上级 52c9d2ba
...@@ -127,7 +127,7 @@ config X86 ...@@ -127,7 +127,7 @@ config X86
select MODULES_USE_ELF_RELA if X86_64 select MODULES_USE_ELF_RELA if X86_64
select CLONE_BACKWARDS if X86_32 select CLONE_BACKWARDS if X86_32
select ARCH_USE_BUILTIN_BSWAP select ARCH_USE_BUILTIN_BSWAP
select ARCH_USE_QUEUED_SPINLOCK select ARCH_USE_QUEUED_SPINLOCKS
select ARCH_USE_QUEUE_RWLOCK select ARCH_USE_QUEUE_RWLOCK
select OLD_SIGSUSPEND3 if X86_32 || IA32_EMULATION select OLD_SIGSUSPEND3 if X86_32 || IA32_EMULATION
select OLD_SIGACTION if X86_32 select OLD_SIGACTION if X86_32
...@@ -667,7 +667,7 @@ config PARAVIRT_DEBUG ...@@ -667,7 +667,7 @@ config PARAVIRT_DEBUG
config PARAVIRT_SPINLOCKS config PARAVIRT_SPINLOCKS
bool "Paravirtualization layer for spinlocks" bool "Paravirtualization layer for spinlocks"
depends on PARAVIRT && SMP depends on PARAVIRT && SMP
select UNINLINE_SPIN_UNLOCK if !QUEUED_SPINLOCK select UNINLINE_SPIN_UNLOCK if !QUEUED_SPINLOCKS
---help--- ---help---
Paravirtualized spinlocks allow a pvops backend to replace the Paravirtualized spinlocks allow a pvops backend to replace the
spinlock implementation with something virtualization-friendly spinlock implementation with something virtualization-friendly
......
...@@ -712,7 +712,7 @@ static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx, ...@@ -712,7 +712,7 @@ static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx,
#if defined(CONFIG_SMP) && defined(CONFIG_PARAVIRT_SPINLOCKS) #if defined(CONFIG_SMP) && defined(CONFIG_PARAVIRT_SPINLOCKS)
#ifdef CONFIG_QUEUED_SPINLOCK #ifdef CONFIG_QUEUED_SPINLOCKS
static __always_inline void pv_queued_spin_lock_slowpath(struct qspinlock *lock, static __always_inline void pv_queued_spin_lock_slowpath(struct qspinlock *lock,
u32 val) u32 val)
...@@ -735,7 +735,7 @@ static __always_inline void pv_kick(int cpu) ...@@ -735,7 +735,7 @@ static __always_inline void pv_kick(int cpu)
PVOP_VCALL1(pv_lock_ops.kick, cpu); PVOP_VCALL1(pv_lock_ops.kick, cpu);
} }
#else /* !CONFIG_QUEUED_SPINLOCK */ #else /* !CONFIG_QUEUED_SPINLOCKS */
static __always_inline void __ticket_lock_spinning(struct arch_spinlock *lock, static __always_inline void __ticket_lock_spinning(struct arch_spinlock *lock,
__ticket_t ticket) __ticket_t ticket)
...@@ -749,7 +749,7 @@ static __always_inline void __ticket_unlock_kick(struct arch_spinlock *lock, ...@@ -749,7 +749,7 @@ static __always_inline void __ticket_unlock_kick(struct arch_spinlock *lock,
PVOP_VCALL2(pv_lock_ops.unlock_kick, lock, ticket); PVOP_VCALL2(pv_lock_ops.unlock_kick, lock, ticket);
} }
#endif /* CONFIG_QUEUED_SPINLOCK */ #endif /* CONFIG_QUEUED_SPINLOCKS */
#endif /* SMP && PARAVIRT_SPINLOCKS */ #endif /* SMP && PARAVIRT_SPINLOCKS */
......
...@@ -336,16 +336,16 @@ typedef u16 __ticket_t; ...@@ -336,16 +336,16 @@ typedef u16 __ticket_t;
struct qspinlock; struct qspinlock;
struct pv_lock_ops { struct pv_lock_ops {
#ifdef CONFIG_QUEUED_SPINLOCK #ifdef CONFIG_QUEUED_SPINLOCKS
void (*queued_spin_lock_slowpath)(struct qspinlock *lock, u32 val); void (*queued_spin_lock_slowpath)(struct qspinlock *lock, u32 val);
struct paravirt_callee_save queued_spin_unlock; struct paravirt_callee_save queued_spin_unlock;
void (*wait)(u8 *ptr, u8 val); void (*wait)(u8 *ptr, u8 val);
void (*kick)(int cpu); void (*kick)(int cpu);
#else /* !CONFIG_QUEUED_SPINLOCK */ #else /* !CONFIG_QUEUED_SPINLOCKS */
struct paravirt_callee_save lock_spinning; struct paravirt_callee_save lock_spinning;
void (*unlock_kick)(struct arch_spinlock *lock, __ticket_t ticket); void (*unlock_kick)(struct arch_spinlock *lock, __ticket_t ticket);
#endif /* !CONFIG_QUEUED_SPINLOCK */ #endif /* !CONFIG_QUEUED_SPINLOCKS */
}; };
/* This contains all the paravirt structures: we get a convenient /* This contains all the paravirt structures: we get a convenient
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
extern struct static_key paravirt_ticketlocks_enabled; extern struct static_key paravirt_ticketlocks_enabled;
static __always_inline bool static_key_false(struct static_key *key); static __always_inline bool static_key_false(struct static_key *key);
#ifdef CONFIG_QUEUED_SPINLOCK #ifdef CONFIG_QUEUED_SPINLOCKS
#include <asm/qspinlock.h> #include <asm/qspinlock.h>
#else #else
...@@ -200,7 +200,7 @@ static inline void arch_spin_unlock_wait(arch_spinlock_t *lock) ...@@ -200,7 +200,7 @@ static inline void arch_spin_unlock_wait(arch_spinlock_t *lock)
cpu_relax(); cpu_relax();
} }
} }
#endif /* CONFIG_QUEUED_SPINLOCK */ #endif /* CONFIG_QUEUED_SPINLOCKS */
/* /*
* Read-write spinlocks, allowing multiple readers * Read-write spinlocks, allowing multiple readers
......
...@@ -23,7 +23,7 @@ typedef u32 __ticketpair_t; ...@@ -23,7 +23,7 @@ typedef u32 __ticketpair_t;
#define TICKET_SHIFT (sizeof(__ticket_t) * 8) #define TICKET_SHIFT (sizeof(__ticket_t) * 8)
#ifdef CONFIG_QUEUED_SPINLOCK #ifdef CONFIG_QUEUED_SPINLOCKS
#include <asm-generic/qspinlock_types.h> #include <asm-generic/qspinlock_types.h>
#else #else
typedef struct arch_spinlock { typedef struct arch_spinlock {
...@@ -36,7 +36,7 @@ typedef struct arch_spinlock { ...@@ -36,7 +36,7 @@ typedef struct arch_spinlock {
} arch_spinlock_t; } arch_spinlock_t;
#define __ARCH_SPIN_LOCK_UNLOCKED { { 0 } } #define __ARCH_SPIN_LOCK_UNLOCKED { { 0 } }
#endif /* CONFIG_QUEUED_SPINLOCK */ #endif /* CONFIG_QUEUED_SPINLOCKS */
#include <asm-generic/qrwlock_types.h> #include <asm-generic/qrwlock_types.h>
......
...@@ -585,7 +585,7 @@ static void kvm_kick_cpu(int cpu) ...@@ -585,7 +585,7 @@ static void kvm_kick_cpu(int cpu)
} }
#ifdef CONFIG_QUEUED_SPINLOCK #ifdef CONFIG_QUEUED_SPINLOCKS
#include <asm/qspinlock.h> #include <asm/qspinlock.h>
...@@ -615,7 +615,7 @@ static void kvm_wait(u8 *ptr, u8 val) ...@@ -615,7 +615,7 @@ static void kvm_wait(u8 *ptr, u8 val)
local_irq_restore(flags); local_irq_restore(flags);
} }
#else /* !CONFIG_QUEUED_SPINLOCK */ #else /* !CONFIG_QUEUED_SPINLOCKS */
enum kvm_contention_stat { enum kvm_contention_stat {
TAKEN_SLOW, TAKEN_SLOW,
...@@ -850,7 +850,7 @@ static void kvm_unlock_kick(struct arch_spinlock *lock, __ticket_t ticket) ...@@ -850,7 +850,7 @@ static void kvm_unlock_kick(struct arch_spinlock *lock, __ticket_t ticket)
} }
} }
#endif /* !CONFIG_QUEUED_SPINLOCK */ #endif /* !CONFIG_QUEUED_SPINLOCKS */
/* /*
* Setup pv_lock_ops to exploit KVM_FEATURE_PV_UNHALT if present. * Setup pv_lock_ops to exploit KVM_FEATURE_PV_UNHALT if present.
...@@ -863,13 +863,13 @@ void __init kvm_spinlock_init(void) ...@@ -863,13 +863,13 @@ void __init kvm_spinlock_init(void)
if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT)) if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT))
return; return;
#ifdef CONFIG_QUEUED_SPINLOCK #ifdef CONFIG_QUEUED_SPINLOCKS
__pv_init_lock_hash(); __pv_init_lock_hash();
pv_lock_ops.queued_spin_lock_slowpath = __pv_queued_spin_lock_slowpath; pv_lock_ops.queued_spin_lock_slowpath = __pv_queued_spin_lock_slowpath;
pv_lock_ops.queued_spin_unlock = PV_CALLEE_SAVE(__pv_queued_spin_unlock); pv_lock_ops.queued_spin_unlock = PV_CALLEE_SAVE(__pv_queued_spin_unlock);
pv_lock_ops.wait = kvm_wait; pv_lock_ops.wait = kvm_wait;
pv_lock_ops.kick = kvm_kick_cpu; pv_lock_ops.kick = kvm_kick_cpu;
#else /* !CONFIG_QUEUED_SPINLOCK */ #else /* !CONFIG_QUEUED_SPINLOCKS */
pv_lock_ops.lock_spinning = PV_CALLEE_SAVE(kvm_lock_spinning); pv_lock_ops.lock_spinning = PV_CALLEE_SAVE(kvm_lock_spinning);
pv_lock_ops.unlock_kick = kvm_unlock_kick; pv_lock_ops.unlock_kick = kvm_unlock_kick;
#endif #endif
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include <asm/paravirt.h> #include <asm/paravirt.h>
#ifdef CONFIG_QUEUED_SPINLOCK #ifdef CONFIG_QUEUED_SPINLOCKS
__visible void __native_queued_spin_unlock(struct qspinlock *lock) __visible void __native_queued_spin_unlock(struct qspinlock *lock)
{ {
native_queued_spin_unlock(lock); native_queued_spin_unlock(lock);
...@@ -25,15 +25,15 @@ bool pv_is_native_spin_unlock(void) ...@@ -25,15 +25,15 @@ bool pv_is_native_spin_unlock(void)
struct pv_lock_ops pv_lock_ops = { struct pv_lock_ops pv_lock_ops = {
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
#ifdef CONFIG_QUEUED_SPINLOCK #ifdef CONFIG_QUEUED_SPINLOCKS
.queued_spin_lock_slowpath = native_queued_spin_lock_slowpath, .queued_spin_lock_slowpath = native_queued_spin_lock_slowpath,
.queued_spin_unlock = PV_CALLEE_SAVE(__native_queued_spin_unlock), .queued_spin_unlock = PV_CALLEE_SAVE(__native_queued_spin_unlock),
.wait = paravirt_nop, .wait = paravirt_nop,
.kick = paravirt_nop, .kick = paravirt_nop,
#else /* !CONFIG_QUEUED_SPINLOCK */ #else /* !CONFIG_QUEUED_SPINLOCKS */
.lock_spinning = __PV_IS_CALLEE_SAVE(paravirt_nop), .lock_spinning = __PV_IS_CALLEE_SAVE(paravirt_nop),
.unlock_kick = paravirt_nop, .unlock_kick = paravirt_nop,
#endif /* !CONFIG_QUEUED_SPINLOCK */ #endif /* !CONFIG_QUEUED_SPINLOCKS */
#endif /* SMP */ #endif /* SMP */
}; };
EXPORT_SYMBOL(pv_lock_ops); EXPORT_SYMBOL(pv_lock_ops);
......
...@@ -21,7 +21,7 @@ DEF_NATIVE(pv_cpu_ops, swapgs, "swapgs"); ...@@ -21,7 +21,7 @@ DEF_NATIVE(pv_cpu_ops, swapgs, "swapgs");
DEF_NATIVE(, mov32, "mov %edi, %eax"); DEF_NATIVE(, mov32, "mov %edi, %eax");
DEF_NATIVE(, mov64, "mov %rdi, %rax"); DEF_NATIVE(, mov64, "mov %rdi, %rax");
#if defined(CONFIG_PARAVIRT_SPINLOCKS) && defined(CONFIG_QUEUED_SPINLOCK) #if defined(CONFIG_PARAVIRT_SPINLOCKS) && defined(CONFIG_QUEUED_SPINLOCKS)
DEF_NATIVE(pv_lock_ops, queued_spin_unlock, "movb $0, (%rdi)"); DEF_NATIVE(pv_lock_ops, queued_spin_unlock, "movb $0, (%rdi)");
#endif #endif
...@@ -65,7 +65,7 @@ unsigned native_patch(u8 type, u16 clobbers, void *ibuf, ...@@ -65,7 +65,7 @@ unsigned native_patch(u8 type, u16 clobbers, void *ibuf,
PATCH_SITE(pv_cpu_ops, clts); PATCH_SITE(pv_cpu_ops, clts);
PATCH_SITE(pv_mmu_ops, flush_tlb_single); PATCH_SITE(pv_mmu_ops, flush_tlb_single);
PATCH_SITE(pv_cpu_ops, wbinvd); PATCH_SITE(pv_cpu_ops, wbinvd);
#if defined(CONFIG_PARAVIRT_SPINLOCKS) && defined(CONFIG_QUEUED_SPINLOCK) #if defined(CONFIG_PARAVIRT_SPINLOCKS) && defined(CONFIG_QUEUED_SPINLOCKS)
case PARAVIRT_PATCH(pv_lock_ops.queued_spin_unlock): case PARAVIRT_PATCH(pv_lock_ops.queued_spin_unlock):
if (pv_is_native_spin_unlock()) { if (pv_is_native_spin_unlock()) {
start = start_pv_lock_ops_queued_spin_unlock; start = start_pv_lock_ops_queued_spin_unlock;
......
...@@ -21,7 +21,7 @@ static DEFINE_PER_CPU(int, lock_kicker_irq) = -1; ...@@ -21,7 +21,7 @@ static DEFINE_PER_CPU(int, lock_kicker_irq) = -1;
static DEFINE_PER_CPU(char *, irq_name); static DEFINE_PER_CPU(char *, irq_name);
static bool xen_pvspin = true; static bool xen_pvspin = true;
#ifdef CONFIG_QUEUED_SPINLOCK #ifdef CONFIG_QUEUED_SPINLOCKS
#include <asm/qspinlock.h> #include <asm/qspinlock.h>
...@@ -65,7 +65,7 @@ static void xen_qlock_wait(u8 *byte, u8 val) ...@@ -65,7 +65,7 @@ static void xen_qlock_wait(u8 *byte, u8 val)
xen_poll_irq(irq); xen_poll_irq(irq);
} }
#else /* CONFIG_QUEUED_SPINLOCK */ #else /* CONFIG_QUEUED_SPINLOCKS */
enum xen_contention_stat { enum xen_contention_stat {
TAKEN_SLOW, TAKEN_SLOW,
...@@ -264,7 +264,7 @@ static void xen_unlock_kick(struct arch_spinlock *lock, __ticket_t next) ...@@ -264,7 +264,7 @@ static void xen_unlock_kick(struct arch_spinlock *lock, __ticket_t next)
} }
} }
} }
#endif /* CONFIG_QUEUED_SPINLOCK */ #endif /* CONFIG_QUEUED_SPINLOCKS */
static irqreturn_t dummy_handler(int irq, void *dev_id) static irqreturn_t dummy_handler(int irq, void *dev_id)
{ {
...@@ -328,7 +328,7 @@ void __init xen_init_spinlocks(void) ...@@ -328,7 +328,7 @@ void __init xen_init_spinlocks(void)
return; return;
} }
printk(KERN_DEBUG "xen: PV spinlocks enabled\n"); printk(KERN_DEBUG "xen: PV spinlocks enabled\n");
#ifdef CONFIG_QUEUED_SPINLOCK #ifdef CONFIG_QUEUED_SPINLOCKS
__pv_init_lock_hash(); __pv_init_lock_hash();
pv_lock_ops.queued_spin_lock_slowpath = __pv_queued_spin_lock_slowpath; pv_lock_ops.queued_spin_lock_slowpath = __pv_queued_spin_lock_slowpath;
pv_lock_ops.queued_spin_unlock = PV_CALLEE_SAVE(__pv_queued_spin_unlock); pv_lock_ops.queued_spin_unlock = PV_CALLEE_SAVE(__pv_queued_spin_unlock);
...@@ -366,7 +366,7 @@ static __init int xen_parse_nopvspin(char *arg) ...@@ -366,7 +366,7 @@ static __init int xen_parse_nopvspin(char *arg)
} }
early_param("xen_nopvspin", xen_parse_nopvspin); early_param("xen_nopvspin", xen_parse_nopvspin);
#if defined(CONFIG_XEN_DEBUG_FS) && !defined(CONFIG_QUEUED_SPINLOCK) #if defined(CONFIG_XEN_DEBUG_FS) && !defined(CONFIG_QUEUED_SPINLOCKS)
static struct dentry *d_spin_debug; static struct dentry *d_spin_debug;
......
...@@ -235,11 +235,11 @@ config LOCK_SPIN_ON_OWNER ...@@ -235,11 +235,11 @@ config LOCK_SPIN_ON_OWNER
def_bool y def_bool y
depends on MUTEX_SPIN_ON_OWNER || RWSEM_SPIN_ON_OWNER depends on MUTEX_SPIN_ON_OWNER || RWSEM_SPIN_ON_OWNER
config ARCH_USE_QUEUED_SPINLOCK config ARCH_USE_QUEUED_SPINLOCKS
bool bool
config QUEUED_SPINLOCK config QUEUED_SPINLOCKS
def_bool y if ARCH_USE_QUEUED_SPINLOCK def_bool y if ARCH_USE_QUEUED_SPINLOCKS
depends on SMP depends on SMP
config ARCH_USE_QUEUE_RWLOCK config ARCH_USE_QUEUE_RWLOCK
......
...@@ -17,7 +17,7 @@ obj-$(CONFIG_SMP) += spinlock.o ...@@ -17,7 +17,7 @@ obj-$(CONFIG_SMP) += spinlock.o
obj-$(CONFIG_LOCK_SPIN_ON_OWNER) += osq_lock.o obj-$(CONFIG_LOCK_SPIN_ON_OWNER) += osq_lock.o
obj-$(CONFIG_SMP) += lglock.o obj-$(CONFIG_SMP) += lglock.o
obj-$(CONFIG_PROVE_LOCKING) += spinlock.o obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
obj-$(CONFIG_QUEUED_SPINLOCK) += qspinlock.o obj-$(CONFIG_QUEUED_SPINLOCKS) += qspinlock.o
obj-$(CONFIG_RT_MUTEXES) += rtmutex.o obj-$(CONFIG_RT_MUTEXES) += rtmutex.o
obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o
obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册