lkml.org 
[lkml]   [2022]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 12/13] locking/qspinlock: separate pv_wait_node from the non-paravirt path
    Date
    pv_wait_node waits until node->locked is non-zero, no need for the
    pv case to wait again by also executing the !pv code path.

    Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
    ---
    kernel/locking/qspinlock.c | 5 +++--
    1 file changed, 3 insertions(+), 2 deletions(-)

    diff --git a/kernel/locking/qspinlock.c b/kernel/locking/qspinlock.c
    index 9db168753124..19e2f286be0a 100644
    --- a/kernel/locking/qspinlock.c
    +++ b/kernel/locking/qspinlock.c
    @@ -862,10 +862,11 @@ static inline void queued_spin_lock_mcs_queue(struct qspinlock *lock, bool parav
    /* Link @node into the waitqueue. */
    WRITE_ONCE(prev->next, node);

    + /* Wait for mcs node lock to be released */
    if (paravirt)
    pv_wait_node(node, prev);
    - /* Wait for mcs node lock to be released */
    - smp_cond_load_acquire(&node->locked, VAL);
    + else
    + smp_cond_load_acquire(&node->locked, VAL);

    /*
    * While waiting for the MCS lock, the next pointer may have
    --
    2.35.1
    \
     
     \ /
      Last update: 2022-07-04 16:40    [W:3.340 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site