@@ -1954,12 +1954,26 @@ static inline int futex_requeue_pi_wakeup_sync(struct futex_q *q)
19541954 * @hb: the hash_bucket of the requeue target futex
19551955 *
19561956 * During futex_requeue, with requeue_pi=1, it is possible to acquire the
1957- * target futex if it is uncontended or via a lock steal. Set the futex_q key
1958- * to the requeue target futex so the waiter can detect the wakeup on the right
1959- * futex, but remove it from the hb and NULL the rt_waiter so it can detect
1960- * atomic lock acquisition. Set the q->lock_ptr to the requeue target hb->lock
1961- * to protect access to the pi_state to fixup the owner later. Must be called
1962- * with both q->lock_ptr and hb->lock held.
1957+ * target futex if it is uncontended or via a lock steal.
1958+ *
1959+ * 1) Set @q::key to the requeue target futex key so the waiter can detect
1960+ * the wakeup on the right futex.
1961+ *
1962+ * 2) Dequeue @q from the hash bucket.
1963+ *
1964+ * 3) Set @q::rt_waiter to NULL so the woken up task can detect atomic lock
1965+ * acquisition.
1966+ *
1967+ * 4) Set the q->lock_ptr to the requeue target hb->lock for the case that
1968+ * the waiter has to fixup the pi state.
1969+ *
1970+ * 5) Complete the requeue state so the waiter can make progress. After
1971+ * this point the waiter task can return from the syscall immediately in
1972+ * case that the pi state does not have to be fixed up.
1973+ *
1974+ * 6) Wake the waiter task.
1975+ *
1976+ * Must be called with both q->lock_ptr and hb->lock held.
19631977 */
19641978static inline
19651979void requeue_pi_wake_futex (struct futex_q * q , union futex_key * key ,
0 commit comments