···13631363{13641364 struct futex_hash_bucket *hb;1365136513661366- get_futex_key_refs(&q->key);13671366 hb = hash_futex(&q->key);13681367 q->lock_ptr = &hb->lock;13691368···13741375queue_unlock(struct futex_q *q, struct futex_hash_bucket *hb)13751376{13761377 spin_unlock(&hb->lock);13771377- drop_futex_key_refs(&q->key);13781378}1379137913801380/**···14781480 q->pi_state = NULL;1479148114801482 spin_unlock(q->lock_ptr);14811481-14821482- drop_futex_key_refs(&q->key);14831483}1484148414851485/*···18081812 }1809181318101814retry:18111811- /* Prepare to wait on uaddr. */18151815+ /*18161816+ * Prepare to wait on uaddr. On success, holds hb lock and increments18171817+ * q.key refs.18181818+ */18121819 ret = futex_wait_setup(uaddr, val, fshared, &q, &hb);18131820 if (ret)18141821 goto out;···1821182218221823 /* If we were woken (and unqueued), we succeeded, whatever. */18231824 ret = 0;18251825+ /* unqueue_me() drops q.key ref */18241826 if (!unqueue_me(&q))18251825- goto out_put_key;18271827+ goto out;18261828 ret = -ETIMEDOUT;18271829 if (to && !to->task)18281828- goto out_put_key;18301830+ goto out;1829183118301832 /*18311833 * We expect signal_pending(current), but we might be the18321834 * victim of a spurious wakeup as well.18331835 */18341834- if (!signal_pending(current)) {18351835- put_futex_key(fshared, &q.key);18361836+ if (!signal_pending(current))18361837 goto retry;18371837- }1838183818391839 ret = -ERESTARTSYS;18401840 if (!abs_time)18411841- goto out_put_key;18411841+ goto out;1842184218431843 restart = ¤t_thread_info()->restart_block;18441844 restart->fn = futex_wait_restart;···1854185618551857 ret = -ERESTART_RESTARTBLOCK;1856185818571857-out_put_key:18581858- put_futex_key(fshared, &q.key);18591859out:18601860 if (to) {18611861 hrtimer_cancel(&to->timer);···22322236 q.rt_waiter = &rt_waiter;22332237 q.requeue_pi_key = &key2;2234223822352235- /* Prepare to wait on uaddr. */22392239+ /*22402240+ * Prepare to wait on uaddr. On success, increments q.key (key1) ref22412241+ * count.22422242+ */22362243 ret = futex_wait_setup(uaddr, val, fshared, &q, &hb);22372244 if (ret)22382245 goto out_key2;···22532254 * In order for us to be here, we know our q.key == key2, and since22542255 * we took the hb->lock above, we also know that futex_requeue() has22552256 * completed and we no longer have to concern ourselves with a wakeup22562256- * race with the atomic proxy lock acquition by the requeue code.22572257+ * race with the atomic proxy lock acquisition by the requeue code. The22582258+ * futex_requeue dropped our key1 reference and incremented our key222592259+ * reference count.22572260 */2258226122592262 /* Check if the requeue code acquired the second futex for us. */