qspinlock.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. /*
  2. * Queued spinlock
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
  15. * (C) Copyright 2013-2014 Red Hat, Inc.
  16. * (C) Copyright 2015 Intel Corp.
  17. * (C) Copyright 2015 Hewlett-Packard Enterprise Development LP
  18. *
  19. * Authors: Waiman Long <waiman.long@hpe.com>
  20. * Peter Zijlstra <peterz@infradead.org>
  21. */
  22. #ifndef _GEN_PV_LOCK_SLOWPATH
  23. #include <linux/smp.h>
  24. #include <linux/bug.h>
  25. #include <linux/cpumask.h>
  26. #include <linux/percpu.h>
  27. #include <linux/hardirq.h>
  28. #include <linux/mutex.h>
  29. #include <asm/byteorder.h>
  30. #include <asm/qspinlock.h>
  31. /*
  32. * The basic principle of a queue-based spinlock can best be understood
  33. * by studying a classic queue-based spinlock implementation called the
  34. * MCS lock. The paper below provides a good description for this kind
  35. * of lock.
  36. *
  37. * http://www.cise.ufl.edu/tr/DOC/REP-1992-71.pdf
  38. *
  39. * This queued spinlock implementation is based on the MCS lock, however to make
  40. * it fit the 4 bytes we assume spinlock_t to be, and preserve its existing
  41. * API, we must modify it somehow.
  42. *
  43. * In particular; where the traditional MCS lock consists of a tail pointer
  44. * (8 bytes) and needs the next pointer (another 8 bytes) of its own node to
  45. * unlock the next pending (next->locked), we compress both these: {tail,
  46. * next->locked} into a single u32 value.
  47. *
  48. * Since a spinlock disables recursion of its own context and there is a limit
  49. * to the contexts that can nest; namely: task, softirq, hardirq, nmi. As there
  50. * are at most 4 nesting levels, it can be encoded by a 2-bit number. Now
  51. * we can encode the tail by combining the 2-bit nesting level with the cpu
  52. * number. With one byte for the lock value and 3 bytes for the tail, only a
  53. * 32-bit word is now needed. Even though we only need 1 bit for the lock,
  54. * we extend it to a full byte to achieve better performance for architectures
  55. * that support atomic byte write.
  56. *
  57. * We also change the first spinner to spin on the lock bit instead of its
  58. * node; whereby avoiding the need to carry a node from lock to unlock, and
  59. * preserving existing lock API. This also makes the unlock code simpler and
  60. * faster.
  61. *
  62. * N.B. The current implementation only supports architectures that allow
  63. * atomic operations on smaller 8-bit and 16-bit data types.
  64. *
  65. */
  66. #include "mcs_spinlock.h"
  67. #ifdef CONFIG_PARAVIRT_SPINLOCKS
  68. #define MAX_NODES 8
  69. #else
  70. #define MAX_NODES 4
  71. #endif
  72. /*
  73. * Per-CPU queue node structures; we can never have more than 4 nested
  74. * contexts: task, softirq, hardirq, nmi.
  75. *
  76. * Exactly fits one 64-byte cacheline on a 64-bit architecture.
  77. *
  78. * PV doubles the storage and uses the second cacheline for PV state.
  79. */
  80. static DEFINE_PER_CPU_ALIGNED(struct mcs_spinlock, mcs_nodes[MAX_NODES]);
  81. /*
  82. * We must be able to distinguish between no-tail and the tail at 0:0,
  83. * therefore increment the cpu number by one.
  84. */
  85. static inline __pure u32 encode_tail(int cpu, int idx)
  86. {
  87. u32 tail;
  88. #ifdef CONFIG_DEBUG_SPINLOCK
  89. BUG_ON(idx > 3);
  90. #endif
  91. tail = (cpu + 1) << _Q_TAIL_CPU_OFFSET;
  92. tail |= idx << _Q_TAIL_IDX_OFFSET; /* assume < 4 */
  93. return tail;
  94. }
  95. static inline __pure struct mcs_spinlock *decode_tail(u32 tail)
  96. {
  97. int cpu = (tail >> _Q_TAIL_CPU_OFFSET) - 1;
  98. int idx = (tail & _Q_TAIL_IDX_MASK) >> _Q_TAIL_IDX_OFFSET;
  99. return per_cpu_ptr(&mcs_nodes[idx], cpu);
  100. }
  101. #define _Q_LOCKED_PENDING_MASK (_Q_LOCKED_MASK | _Q_PENDING_MASK)
  102. /*
  103. * By using the whole 2nd least significant byte for the pending bit, we
  104. * can allow better optimization of the lock acquisition for the pending
  105. * bit holder.
  106. *
  107. * This internal structure is also used by the set_locked function which
  108. * is not restricted to _Q_PENDING_BITS == 8.
  109. */
  110. struct __qspinlock {
  111. union {
  112. atomic_t val;
  113. #ifdef __LITTLE_ENDIAN
  114. struct {
  115. u8 locked;
  116. u8 pending;
  117. };
  118. struct {
  119. u16 locked_pending;
  120. u16 tail;
  121. };
  122. #else
  123. struct {
  124. u16 tail;
  125. u16 locked_pending;
  126. };
  127. struct {
  128. u8 reserved[2];
  129. u8 pending;
  130. u8 locked;
  131. };
  132. #endif
  133. };
  134. };
  135. #if _Q_PENDING_BITS == 8
  136. /**
  137. * clear_pending_set_locked - take ownership and clear the pending bit.
  138. * @lock: Pointer to queued spinlock structure
  139. *
  140. * *,1,0 -> *,0,1
  141. *
  142. * Lock stealing is not allowed if this function is used.
  143. */
  144. static __always_inline void clear_pending_set_locked(struct qspinlock *lock)
  145. {
  146. struct __qspinlock *l = (void *)lock;
  147. WRITE_ONCE(l->locked_pending, _Q_LOCKED_VAL);
  148. }
  149. /*
  150. * xchg_tail - Put in the new queue tail code word & retrieve previous one
  151. * @lock : Pointer to queued spinlock structure
  152. * @tail : The new queue tail code word
  153. * Return: The previous queue tail code word
  154. *
  155. * xchg(lock, tail)
  156. *
  157. * p,*,* -> n,*,* ; prev = xchg(lock, node)
  158. */
  159. static __always_inline u32 xchg_tail(struct qspinlock *lock, u32 tail)
  160. {
  161. struct __qspinlock *l = (void *)lock;
  162. /*
  163. * Use release semantics to make sure that the MCS node is properly
  164. * initialized before changing the tail code.
  165. */
  166. return (u32)xchg_release(&l->tail,
  167. tail >> _Q_TAIL_OFFSET) << _Q_TAIL_OFFSET;
  168. }
  169. #else /* _Q_PENDING_BITS == 8 */
  170. /**
  171. * clear_pending_set_locked - take ownership and clear the pending bit.
  172. * @lock: Pointer to queued spinlock structure
  173. *
  174. * *,1,0 -> *,0,1
  175. */
  176. static __always_inline void clear_pending_set_locked(struct qspinlock *lock)
  177. {
  178. atomic_add(-_Q_PENDING_VAL + _Q_LOCKED_VAL, &lock->val);
  179. }
  180. /**
  181. * xchg_tail - Put in the new queue tail code word & retrieve previous one
  182. * @lock : Pointer to queued spinlock structure
  183. * @tail : The new queue tail code word
  184. * Return: The previous queue tail code word
  185. *
  186. * xchg(lock, tail)
  187. *
  188. * p,*,* -> n,*,* ; prev = xchg(lock, node)
  189. */
  190. static __always_inline u32 xchg_tail(struct qspinlock *lock, u32 tail)
  191. {
  192. u32 old, new, val = atomic_read(&lock->val);
  193. for (;;) {
  194. new = (val & _Q_LOCKED_PENDING_MASK) | tail;
  195. /*
  196. * Use release semantics to make sure that the MCS node is
  197. * properly initialized before changing the tail code.
  198. */
  199. old = atomic_cmpxchg_release(&lock->val, val, new);
  200. if (old == val)
  201. break;
  202. val = old;
  203. }
  204. return old;
  205. }
  206. #endif /* _Q_PENDING_BITS == 8 */
  207. /**
  208. * set_locked - Set the lock bit and own the lock
  209. * @lock: Pointer to queued spinlock structure
  210. *
  211. * *,*,0 -> *,0,1
  212. */
  213. static __always_inline void set_locked(struct qspinlock *lock)
  214. {
  215. struct __qspinlock *l = (void *)lock;
  216. WRITE_ONCE(l->locked, _Q_LOCKED_VAL);
  217. }
  218. /*
  219. * Generate the native code for queued_spin_unlock_slowpath(); provide NOPs for
  220. * all the PV callbacks.
  221. */
  222. static __always_inline void __pv_init_node(struct mcs_spinlock *node) { }
  223. static __always_inline void __pv_wait_node(struct mcs_spinlock *node,
  224. struct mcs_spinlock *prev) { }
  225. static __always_inline void __pv_kick_node(struct qspinlock *lock,
  226. struct mcs_spinlock *node) { }
  227. static __always_inline u32 __pv_wait_head_or_lock(struct qspinlock *lock,
  228. struct mcs_spinlock *node)
  229. { return 0; }
  230. #define pv_enabled() false
  231. #define pv_init_node __pv_init_node
  232. #define pv_wait_node __pv_wait_node
  233. #define pv_kick_node __pv_kick_node
  234. #define pv_wait_head_or_lock __pv_wait_head_or_lock
  235. #ifdef CONFIG_PARAVIRT_SPINLOCKS
  236. #define queued_spin_lock_slowpath native_queued_spin_lock_slowpath
  237. #endif
  238. /*
  239. * Various notes on spin_is_locked() and spin_unlock_wait(), which are
  240. * 'interesting' functions:
  241. *
  242. * PROBLEM: some architectures have an interesting issue with atomic ACQUIRE
  243. * operations in that the ACQUIRE applies to the LOAD _not_ the STORE (ARM64,
  244. * PPC). Also qspinlock has a similar issue per construction, the setting of
  245. * the locked byte can be unordered acquiring the lock proper.
  246. *
  247. * This gets to be 'interesting' in the following cases, where the /should/s
  248. * end up false because of this issue.
  249. *
  250. *
  251. * CASE 1:
  252. *
  253. * So the spin_is_locked() correctness issue comes from something like:
  254. *
  255. * CPU0 CPU1
  256. *
  257. * global_lock(); local_lock(i)
  258. * spin_lock(&G) spin_lock(&L[i])
  259. * for (i) if (!spin_is_locked(&G)) {
  260. * spin_unlock_wait(&L[i]); smp_acquire__after_ctrl_dep();
  261. * return;
  262. * }
  263. * // deal with fail
  264. *
  265. * Where it is important CPU1 sees G locked or CPU0 sees L[i] locked such
  266. * that there is exclusion between the two critical sections.
  267. *
  268. * The load from spin_is_locked(&G) /should/ be constrained by the ACQUIRE from
  269. * spin_lock(&L[i]), and similarly the load(s) from spin_unlock_wait(&L[i])
  270. * /should/ be constrained by the ACQUIRE from spin_lock(&G).
  271. *
  272. * Similarly, later stuff is constrained by the ACQUIRE from CTRL+RMB.
  273. *
  274. *
  275. * CASE 2:
  276. *
  277. * For spin_unlock_wait() there is a second correctness issue, namely:
  278. *
  279. * CPU0 CPU1
  280. *
  281. * flag = set;
  282. * smp_mb(); spin_lock(&l)
  283. * spin_unlock_wait(&l); if (!flag)
  284. * // add to lockless list
  285. * spin_unlock(&l);
  286. * // iterate lockless list
  287. *
  288. * Which wants to ensure that CPU1 will stop adding bits to the list and CPU0
  289. * will observe the last entry on the list (if spin_unlock_wait() had ACQUIRE
  290. * semantics etc..)
  291. *
  292. * Where flag /should/ be ordered against the locked store of l.
  293. */
  294. /*
  295. * queued_spin_lock_slowpath() can (load-)ACQUIRE the lock before
  296. * issuing an _unordered_ store to set _Q_LOCKED_VAL.
  297. *
  298. * This means that the store can be delayed, but no later than the
  299. * store-release from the unlock. This means that simply observing
  300. * _Q_LOCKED_VAL is not sufficient to determine if the lock is acquired.
  301. *
  302. * There are two paths that can issue the unordered store:
  303. *
  304. * (1) clear_pending_set_locked(): *,1,0 -> *,0,1
  305. *
  306. * (2) set_locked(): t,0,0 -> t,0,1 ; t != 0
  307. * atomic_cmpxchg_relaxed(): t,0,0 -> 0,0,1
  308. *
  309. * However, in both cases we have other !0 state we've set before to queue
  310. * ourseves:
  311. *
  312. * For (1) we have the atomic_cmpxchg_acquire() that set _Q_PENDING_VAL, our
  313. * load is constrained by that ACQUIRE to not pass before that, and thus must
  314. * observe the store.
  315. *
  316. * For (2) we have a more intersting scenario. We enqueue ourselves using
  317. * xchg_tail(), which ends up being a RELEASE. This in itself is not
  318. * sufficient, however that is followed by an smp_cond_acquire() on the same
  319. * word, giving a RELEASE->ACQUIRE ordering. This again constrains our load and
  320. * guarantees we must observe that store.
  321. *
  322. * Therefore both cases have other !0 state that is observable before the
  323. * unordered locked byte store comes through. This means we can use that to
  324. * wait for the lock store, and then wait for an unlock.
  325. */
  326. #ifndef queued_spin_unlock_wait
  327. void queued_spin_unlock_wait(struct qspinlock *lock)
  328. {
  329. u32 val;
  330. for (;;) {
  331. val = atomic_read(&lock->val);
  332. if (!val) /* not locked, we're done */
  333. goto done;
  334. if (val & _Q_LOCKED_MASK) /* locked, go wait for unlock */
  335. break;
  336. /* not locked, but pending, wait until we observe the lock */
  337. cpu_relax();
  338. }
  339. /* any unlock is good */
  340. while (atomic_read(&lock->val) & _Q_LOCKED_MASK)
  341. cpu_relax();
  342. done:
  343. smp_acquire__after_ctrl_dep();
  344. }
  345. EXPORT_SYMBOL(queued_spin_unlock_wait);
  346. #endif
  347. #endif /* _GEN_PV_LOCK_SLOWPATH */
  348. /**
  349. * queued_spin_lock_slowpath - acquire the queued spinlock
  350. * @lock: Pointer to queued spinlock structure
  351. * @val: Current value of the queued spinlock 32-bit word
  352. *
  353. * (queue tail, pending bit, lock value)
  354. *
  355. * fast : slow : unlock
  356. * : :
  357. * uncontended (0,0,0) -:--> (0,0,1) ------------------------------:--> (*,*,0)
  358. * : | ^--------.------. / :
  359. * : v \ \ | :
  360. * pending : (0,1,1) +--> (0,1,0) \ | :
  361. * : | ^--' | | :
  362. * : v | | :
  363. * uncontended : (n,x,y) +--> (n,0,0) --' | :
  364. * queue : | ^--' | :
  365. * : v | :
  366. * contended : (*,x,y) +--> (*,0,0) ---> (*,0,1) -' :
  367. * queue : ^--' :
  368. */
  369. void queued_spin_lock_slowpath(struct qspinlock *lock, u32 val)
  370. {
  371. struct mcs_spinlock *prev, *next, *node;
  372. u32 new, old, tail;
  373. int idx;
  374. BUILD_BUG_ON(CONFIG_NR_CPUS >= (1U << _Q_TAIL_CPU_BITS));
  375. if (pv_enabled())
  376. goto queue;
  377. if (virt_spin_lock(lock))
  378. return;
  379. /*
  380. * wait for in-progress pending->locked hand-overs
  381. *
  382. * 0,1,0 -> 0,0,1
  383. */
  384. if (val == _Q_PENDING_VAL) {
  385. while ((val = atomic_read(&lock->val)) == _Q_PENDING_VAL)
  386. cpu_relax();
  387. }
  388. /*
  389. * trylock || pending
  390. *
  391. * 0,0,0 -> 0,0,1 ; trylock
  392. * 0,0,1 -> 0,1,1 ; pending
  393. */
  394. for (;;) {
  395. /*
  396. * If we observe any contention; queue.
  397. */
  398. if (val & ~_Q_LOCKED_MASK)
  399. goto queue;
  400. new = _Q_LOCKED_VAL;
  401. if (val == new)
  402. new |= _Q_PENDING_VAL;
  403. /*
  404. * Acquire semantic is required here as the function may
  405. * return immediately if the lock was free.
  406. */
  407. old = atomic_cmpxchg_acquire(&lock->val, val, new);
  408. if (old == val)
  409. break;
  410. val = old;
  411. }
  412. /*
  413. * we won the trylock
  414. */
  415. if (new == _Q_LOCKED_VAL)
  416. return;
  417. /*
  418. * we're pending, wait for the owner to go away.
  419. *
  420. * *,1,1 -> *,1,0
  421. *
  422. * this wait loop must be a load-acquire such that we match the
  423. * store-release that clears the locked bit and create lock
  424. * sequentiality; this is because not all clear_pending_set_locked()
  425. * implementations imply full barriers.
  426. */
  427. smp_cond_load_acquire(&lock->val.counter, !(VAL & _Q_LOCKED_MASK));
  428. /*
  429. * take ownership and clear the pending bit.
  430. *
  431. * *,1,0 -> *,0,1
  432. */
  433. clear_pending_set_locked(lock);
  434. return;
  435. /*
  436. * End of pending bit optimistic spinning and beginning of MCS
  437. * queuing.
  438. */
  439. queue:
  440. node = this_cpu_ptr(&mcs_nodes[0]);
  441. idx = node->count++;
  442. tail = encode_tail(smp_processor_id(), idx);
  443. node += idx;
  444. /*
  445. * Ensure that we increment the head node->count before initialising
  446. * the actual node. If the compiler is kind enough to reorder these
  447. * stores, then an IRQ could overwrite our assignments.
  448. */
  449. barrier();
  450. node->locked = 0;
  451. node->next = NULL;
  452. pv_init_node(node);
  453. /*
  454. * We touched a (possibly) cold cacheline in the per-cpu queue node;
  455. * attempt the trylock once more in the hope someone let go while we
  456. * weren't watching.
  457. */
  458. if (queued_spin_trylock(lock))
  459. goto release;
  460. /*
  461. * We have already touched the queueing cacheline; don't bother with
  462. * pending stuff.
  463. *
  464. * p,*,* -> n,*,*
  465. *
  466. * RELEASE, such that the stores to @node must be complete.
  467. */
  468. old = xchg_tail(lock, tail);
  469. next = NULL;
  470. /*
  471. * if there was a previous node; link it and wait until reaching the
  472. * head of the waitqueue.
  473. */
  474. if (old & _Q_TAIL_MASK) {
  475. prev = decode_tail(old);
  476. /*
  477. * The above xchg_tail() is also a load of @lock which generates,
  478. * through decode_tail(), a pointer.
  479. *
  480. * The address dependency matches the RELEASE of xchg_tail()
  481. * such that the access to @prev must happen after.
  482. */
  483. smp_read_barrier_depends();
  484. WRITE_ONCE(prev->next, node);
  485. pv_wait_node(node, prev);
  486. arch_mcs_spin_lock_contended(&node->locked);
  487. /*
  488. * While waiting for the MCS lock, the next pointer may have
  489. * been set by another lock waiter. We optimistically load
  490. * the next pointer & prefetch the cacheline for writing
  491. * to reduce latency in the upcoming MCS unlock operation.
  492. */
  493. next = READ_ONCE(node->next);
  494. if (next)
  495. prefetchw(next);
  496. }
  497. /*
  498. * we're at the head of the waitqueue, wait for the owner & pending to
  499. * go away.
  500. *
  501. * *,x,y -> *,0,0
  502. *
  503. * this wait loop must use a load-acquire such that we match the
  504. * store-release that clears the locked bit and create lock
  505. * sequentiality; this is because the set_locked() function below
  506. * does not imply a full barrier.
  507. *
  508. * The PV pv_wait_head_or_lock function, if active, will acquire
  509. * the lock and return a non-zero value. So we have to skip the
  510. * smp_cond_load_acquire() call. As the next PV queue head hasn't been
  511. * designated yet, there is no way for the locked value to become
  512. * _Q_SLOW_VAL. So both the set_locked() and the
  513. * atomic_cmpxchg_relaxed() calls will be safe.
  514. *
  515. * If PV isn't active, 0 will be returned instead.
  516. *
  517. */
  518. if ((val = pv_wait_head_or_lock(lock, node)))
  519. goto locked;
  520. val = smp_cond_load_acquire(&lock->val.counter, !(VAL & _Q_LOCKED_PENDING_MASK));
  521. locked:
  522. /*
  523. * claim the lock:
  524. *
  525. * n,0,0 -> 0,0,1 : lock, uncontended
  526. * *,0,0 -> *,0,1 : lock, contended
  527. *
  528. * If the queue head is the only one in the queue (lock value == tail),
  529. * clear the tail code and grab the lock. Otherwise, we only need
  530. * to grab the lock.
  531. */
  532. for (;;) {
  533. /* In the PV case we might already have _Q_LOCKED_VAL set */
  534. if ((val & _Q_TAIL_MASK) != tail) {
  535. set_locked(lock);
  536. break;
  537. }
  538. /*
  539. * The smp_cond_load_acquire() call above has provided the
  540. * necessary acquire semantics required for locking. At most
  541. * two iterations of this loop may be ran.
  542. */
  543. old = atomic_cmpxchg_relaxed(&lock->val, val, _Q_LOCKED_VAL);
  544. if (old == val)
  545. goto release; /* No contention */
  546. val = old;
  547. }
  548. /*
  549. * contended path; wait for next if not observed yet, release.
  550. */
  551. if (!next) {
  552. while (!(next = READ_ONCE(node->next)))
  553. cpu_relax();
  554. }
  555. arch_mcs_spin_unlock_contended(&next->locked);
  556. pv_kick_node(lock, next);
  557. release:
  558. /*
  559. * release the node
  560. */
  561. __this_cpu_dec(mcs_nodes[0].count);
  562. }
  563. EXPORT_SYMBOL(queued_spin_lock_slowpath);
  564. /*
  565. * Generate the paravirt code for queued_spin_unlock_slowpath().
  566. */
  567. #if !defined(_GEN_PV_LOCK_SLOWPATH) && defined(CONFIG_PARAVIRT_SPINLOCKS)
  568. #define _GEN_PV_LOCK_SLOWPATH
  569. #undef pv_enabled
  570. #define pv_enabled() true
  571. #undef pv_init_node
  572. #undef pv_wait_node
  573. #undef pv_kick_node
  574. #undef pv_wait_head_or_lock
  575. #undef queued_spin_lock_slowpath
  576. #define queued_spin_lock_slowpath __pv_queued_spin_lock_slowpath
  577. #include "qspinlock_paravirt.h"
  578. #include "qspinlock.c"
  579. #endif