powerpc/qspinlock: Propagate sleepy if previous waiter is preempted
The sleepy (aka lock-owner-is-preempted) condition is propagated down the queue by each waiter. If a waiter becomes preempted, it can no longer propagate sleepy. To allow subsequent waiters to yield to the lock owner, also check the lock owner in this case. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Tested-by: Shrikanth Hegde <sshegde@linux.vnet.ibm.com> Reviewed-by: "Nysal Jan K.A" <nysal@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20231016124305.139923-6-npiggin@gmail.com
This commit is contained in:
parent
fcf77d4427
commit
1e6d5f7257
@ -384,7 +384,11 @@ static __always_inline bool yield_to_prev(struct qspinlock *lock, struct qnode *
|
||||
if (!pv_yield_propagate_owner)
|
||||
goto yield_prev;
|
||||
|
||||
if (node->sleepy) {
|
||||
/*
|
||||
* If the previous waiter was preempted it might not be able to
|
||||
* propagate sleepy to us, so check the lock in that case too.
|
||||
*/
|
||||
if (node->sleepy || vcpu_is_preempted(prev_cpu)) {
|
||||
u32 val = READ_ONCE(lock->val);
|
||||
|
||||
if (val & _Q_LOCKED_VAL) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user