# define UNLOCK_LOCK_PREFIX
#endif
+ /* How long a lock should spin before we consider blocking */
+ #define SPIN_THRESHOLD (1 << 15)
+
+ extern struct static_key paravirt_ticketlocks_enabled;
+ static __always_inline bool static_key_false(struct static_key *key);
+
+ #ifdef CONFIG_PARAVIRT_SPINLOCKS
+
+ static inline void __ticket_enter_slowpath(arch_spinlock_t *lock)
+ {
+ set_bit(0, (volatile unsigned long *)&lock->tickets.tail);
+ }
+
+ #else /* !CONFIG_PARAVIRT_SPINLOCKS */
+ static __always_inline void __ticket_lock_spinning(arch_spinlock_t *lock,
+ __ticket_t ticket)
+ {
+ }
+ static inline void __ticket_unlock_kick(arch_spinlock_t *lock,
+ __ticket_t ticket)
+ {
+ }
+
+ #endif /* CONFIG_PARAVIRT_SPINLOCKS */
+
+static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock)
+{
+ return lock.tickets.head == lock.tickets.tail;
+}
+
/*
* Ticket locks are conceptually two parts, one indicating the current head of
* the queue, and the other indicating the current tail. The lock is acquired