powerpc/qspinlock: propagate owner preemptedness rather than CPU number
authorNicholas Piggin <npiggin@gmail.com>
Mon, 16 Oct 2023 12:43:02 +0000 (22:43 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 20 Oct 2023 11:43:34 +0000 (22:43 +1100)
commitfd8fae50c9c6117c4e05954deab2cc515508666b
tree8c9b0431aac1e167878219ba6146ce16957b4eff
parentf6568647382c667912245c8d07aa26c9c6d4d0c8
powerpc/qspinlock: propagate owner preemptedness rather than CPU number

Rather than propagating the CPU number of the preempted lock owner,
just propagate whether the owner was preempted. Waiters must read the
lock value when yielding to it to prevent races anyway, so might as
well always load the owner CPU from the lock.

To further simplify the code, also don't propagate the -1 (or
sleepy=false in the new scheme) down the queue. Instead, have the
waiters clear it themselves when finding the lock owner is not
preempted.

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-4-npiggin@gmail.com
arch/powerpc/lib/qspinlock.c