xchg_tail(9)
π 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:
clear_pending(9)clear_pending_set_locked(9)set_locked(9)arena_spin_trylock(9)arena_spin_lock(9)arena_spin_unlock(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms