__vdso_fute...4_try_unlock(9)
π¦ NAME π¦
okay so bestie, __vdso_futex_robust_list64_try_unlock β it tries to unlock an uncontended robust futex with a 64-bit pending op pointer. literally that's the whole vibe β¨
this one lives in the Kernel API Manual, just so u know what corner of the world we're in π«Ά
πΈ SYNOPSIS πΈ
__u32 __vdso_futex_robust_list64_try_unlock (__u32 *lock , __u32 tid ,
__u64 *pop );
π ARGUMENTS π
lockβ pointer to the futex lock object πtidβ the TID of the calling task, iykykpopβ pointer to the task'srobust_list_head::list_pending_opπ
β RETURN β
it hands u back the content of *lock. and on success? that's literally the same as tid. slay π
π₯ DESCRIPTION π₯
so the function implements this exact thing, no cap:
if (atomic_try_cmpxchg(lock, tid, 0)) *op = NULL; return tid;
now here's the tea β β there's a race between a successful unlock and clearing the pending op pointer in the robust list head. like, they're both happening and it's giving chaos π if the calling task gets interrupted inside that race window and has to handle a (fatal) signal on return to user space, then the kernel handles the clearing of pending_op before attempting to deliver the signal. why? because that ensures a task can't exit with a potentially invalid pending op pointer. protection periodt π‘οΈ
user space uses it like this, fr fr:
if (__vdso_futex_robust_list64_try_unlock(lock, tid, pending_op) != tid)
err = sys_futex($OP | FUTEX_ROBUST_UNLOCK,....);
and if the unlock attempt fails because the FUTEX_WAITERS bit is set in the lock? then the syscall does the unlock, clears the pending op pointer, and wakes the requested number of waiters. iconic multi-tasking energy π
π§ SEE ALSO π§
- Kernel file
./include/vdso/futex.h __vdso_futex_robust_list32_try_unlock(9)β the 32-bit bestie, go say hi π¦
and that's the whole page!! sourced from ./include/vdso, dated October 2026 β mwah, drink water, and may ur futexes never stay contended ππβ¨
π¦ 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