LOCK ORDERING(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ lock ordering πŸŽ€

okay bestie, welcome to the kernel API manual corner of the internet πŸ’… this page is literally just called lock ordering and it's about the two locks that are lowkey the main characters of the queuing routines: the qp s_lock and the exp_lock. that's it, that's the vibe check 🫢


πŸ”’ the actual tea πŸ”’

so there are two locks involved with the queuing routines: the qp s_lock and the exp_lock. iconic duo, no cap ✨

here's the part where you gotta pay attention: since the tid space allocation gets called from the send engine, the qp s_lock is already held by the time you show up 😭 not new info, just how it is β€” like walking in and the aux is already on.

the allocation routines will get the exp_lock. that's their whole thing. they grab it 🫑

now, the first_qp call is provided so that the head of the rcd wait queue can be fetched under the exp_lock β€” and then, right after, the exp_lock gets dropped. fetch under, drop after. that's the whole choreography, periodt πŸ’ƒ

and one last thing, very important, don't forget it: any qp in the wait list will have the qp reference count held β€” held so the qp stays in memory. literally keeping it alive, main character energy πŸ‘‘

ngl the lock ordering here is not a suggestion, it's the whole plot. respect the plot πŸ™ˆ

✨ SEE ALSO ✨

go read these next, they're all connected, iykyk πŸ’œ


okay that's the page!! mwah πŸ’– this lil legend lives in ./drivers/infiniband/hw/hfi1 and it's dated October 2026 β€” yes, future girl vibes 🌸 go forth and hold your locks in the right order, bestie, i believe in you πŸ¦‹πŸ’…

πŸ“¦ where this page comes from