requeue_pi_wake_futex(9)
π NAME π
okay so bestie, this is requeue_pi_wake_futex(9) from the Kernel API Manual β and it is literally the page for Wake a task that acquired the lock during requeue. π
β¨
β¨ SYNOPSIS β¨
void requeue_pi_wake_futex (struct futex_q *q , union futex_key *key ,
struct futex_hash_bucket *hb );
π ARGUMENTS π
qβ thefutex_q. yep, that one. π«Άkeyβ the key of the requeue target futex. πhbβ thehash_bucketof the requeue target futex. πͺ£
π¦ DESCRIPTION π¦
During futex_requeue, with requeue_pi=1, it is possible to acquire the target futex if it is uncontended or via a lock steal. π― That's the setup, bestie β here's the step-by-step:
- Set
q::keyto the requeue target futex key so the waiter can detect the wakeup on the right futex. π - Dequeue
qfrom the hash bucket. π§Ή - Set
q::rt_waitertoNULLso the woken up task can detect atomic lock acquisition. π« - Set the
q->lock_ptrto the requeue targethb->lockfor the case that the waiter has to fixup the pi state. π§ - Complete the requeue state so the waiter can make progress. After this point the waiter task can return from the syscall immediately in case that the pi state does not have to be fixed up. πββοΈ
- Wake the waiter task. π
β οΈ vibe check, and it's serious: Must be called with bothq->lock_ptrandhb->lockheld. no cap. π
π SEE ALSO π
Kernel file ./kernel/futex/requeue.c β also check requeue_futex(9), futex_proxy_trylock_atomic(9), futex_requeue(9), handle_early_requeue_pi_wakeup(9), and futex_wait_requeue_pi(9). ππ
okay bye bestie π«Ά β source/version: ./kernel/futex β’ date: October 2026 β’ this icon: requeue_pi_wake_futex(9) ππΈ
π¦ 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