resilient_q...ock_slowpath(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ‘‘ NAME πŸ‘‘

resilient_queued_spin_lock_slowpath β€” bestie, this is the function that actually acquires the queued spinlock πŸ’…

And yeah, the manual page itself is titled resilient_q...ock_slowpath(9) because someone in the Kernel API Manual department got a little βœ‚οΈ truncation-happy, but the real one is spelled out above, no cap.


✨ SYNOPSIS ✨

int __lockfunc resilient_queued_spin_lock_slowpath (rqspinlock_t *lock ,
u32 val );

πŸŽ€ ARGUMENTS πŸŽ€

  • lock β€” pointer to the queued spinlock structure 🫢 like, that's the thing you're trying to lock, obviously.
  • val β€” the current value of the queued spinlock's 32-bit word. Yes, it's a u32. Yes, it's the value right now. Keep up bestie πŸ¦‹

🌈 RETURN 🌈

  • 0 β€” slay, the lock was acquired successfully πŸ‘‘
  • -EDEADLK β€” lock acquisition failed because of AA/ABBA deadlock 😭 the drama of it all.
  • -ETIMEDOUT β€” lock acquisition failed because of a timeout πŸ’€ it just took too long and gave up.

πŸ¦‹ DESCRIPTION πŸ¦‹

Ok so here's the whole vibe. The tuple you're looking at the entire time is (queue tail, pending bit, lock value) and it's genuinely giving main character energy:

(queue tail, pending bit, lock value)

fast     :    slow                                  :    unlock :
: uncontended  (0,0,0) -:--> (0,0,1) ------------------------------:-->
(*,*,0) :       | ^--------.------.             /  : :       v
                  |  : pending               :    (0,1,1) +--> (0,1,0)
           |  : :       | ^--'              |           |  : :       v
|           |  : uncontended           :    (n,x,y) +--> (n,0,0) --'
|  : queue               :       | ^--'                          |  : :
v                               |  : contended             :    (*,x,y)
+--> (*,0,0) ---> (*,0,1) -'  : queue               :         ^--'
:

Lowkey an art piece. Highkey a state machine. Read it, live it, love it πŸ’–


⭐ SEE ALSO ⭐

  • Kernel file ./kernel/bpf/rqspinlock.c β€” go read the source if you want the full lore, iykyk πŸ“–

That's the whole page bestie, hope it slaps 🫢 β€” it's from the Kernel API Manual, coming to you courtesy of ./kernel/bpf, dated October 2026 πŸŽ€βœ¨

πŸ“¦ where this page comes from