xchg_tail(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so bestie, welcome to xchg_tail(9) from the Kernel API Manual β€” it’s literally the page for putting in the new queue tail code word & retrieving the previous one πŸ’…βœ¨


✨ SYNOPSIS ✨

u32 xchg_tail (arena_spinlock_t __arena *lock , u32 tail );

πŸŽ€ ARGUMENTS πŸŽ€

  • lock β€” pointer to the queued spinlock structure, bestie 🫢
  • tail β€” the new queue tail code word, no cap πŸ¦‹

πŸ¦‹ RETURN πŸ¦‹

you get back the previous queue tail code word β€” iconic, honestly πŸ‘‘


🌸 DESCRIPTION 🌸

the manpage keeps it super simple and says:

xchg(lock, tail)

and then, fr fr:

p,*,* -> n,*,* ; prev = xchg(lock, node)

that’s the whole vibe check πŸ˜ŒπŸ’œ


πŸ”₯ SEE ALSO πŸ”₯

Kernel file: ./tools/testing/selftests/bpf/libarena/include/bpf_arena_spin_lock.h

also go peek at these besties:


mwah πŸ’‹ stay slay β€” source/version is ./tools/testing/selftests/bpf/..., dated October 2026, and that’s the xchg_tail(9) moment πŸ§šπŸŽ€

πŸ“¦ where this page comes from