lkml.org 
[lkml]   [2021]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[patch 54/63] futex: Cleanup stale comments
    From: Thomas Gleixner <tglx@linutronix.de>

    The futex key reference mechanism is long gone. Cleanup the stale comments
    which still mention it.

    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    ---
    V2: Cleanup more key ref comments - Andre
    ---
    kernel/futex.c | 18 +++++++-----------
    1 file changed, 7 insertions(+), 11 deletions(-)
    ---
    --- a/kernel/futex.c
    +++ b/kernel/futex.c
    @@ -1354,7 +1354,7 @@ static int lock_pi_update_atomic(u32 __u
    * - 1 - acquired the lock;
    * - <0 - error
    *
    - * The hb->lock and futex_key refs shall be held by the caller.
    + * The hb->lock must be held by the caller.
    *
    * @exiting is only set when the return value is -EBUSY. If so, this holds
    * a refcount on the exiting task on return and the caller needs to drop it
    @@ -2618,8 +2618,7 @@ static void futex_wait_queue_me(struct f
    *
    * Setup the futex_q and locate the hash_bucket. Get the futex value and
    * compare it with the expected value. Handle atomic faults internally.
    - * Return with the hb lock held and a q.key reference on success, and unlocked
    - * with no q.key reference on failure.
    + * Return with the hb lock held on success, and unlocked on failure.
    *
    * Return:
    * - 0 - uaddr contains val and hb has been locked;
    @@ -2697,8 +2696,8 @@ static int futex_wait(u32 __user *uaddr,
    current->timer_slack_ns);
    retry:
    /*
    - * Prepare to wait on uaddr. On success, holds hb lock and increments
    - * q.key refs.
    + * Prepare to wait on uaddr. On success, it holds hb->lock and q
    + * is initialized.
    */
    ret = futex_wait_setup(uaddr, val, flags, &q, &hb);
    if (ret)
    @@ -2709,7 +2708,6 @@ static int futex_wait(u32 __user *uaddr,

    /* If we were woken (and unqueued), we succeeded, whatever. */
    ret = 0;
    - /* unqueue_me() drops q.key ref */
    if (!unqueue_me(&q))
    goto out;
    ret = -ETIMEDOUT;
    @@ -3202,8 +3200,8 @@ static int futex_wait_requeue_pi(u32 __u
    q.requeue_pi_key = &key2;

    /*
    - * Prepare to wait on uaddr. On success, increments q.key (key1) ref
    - * count.
    + * Prepare to wait on uaddr. On success, it holds hb->lock and q
    + * is initialized.
    */
    ret = futex_wait_setup(uaddr, val, flags, &q, &hb);
    if (ret)
    @@ -3232,9 +3230,7 @@ static int futex_wait_requeue_pi(u32 __u
    * In order for us to be here, we know our q.key == key2, and since
    * we took the hb->lock above, we also know that futex_requeue() has
    * completed and we no longer have to concern ourselves with a wakeup
    - * race with the atomic proxy lock acquisition by the requeue code. The
    - * futex_requeue dropped our key1 reference and incremented our key2
    - * reference count.
    + * race with the atomic proxy lock acquisition by the requeue code.
    */

    /*
    \
     
     \ /
      Last update: 2021-07-30 16:22    [W:4.236 / U:0.088 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site