aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorNicholas Piggin <[email protected]>2023-10-16 22:43:00 +1000
committerMichael Ellerman <[email protected]>2023-10-18 21:07:21 +1100
commitf9bc9bbe8afdf83412728f0b464979a72a3b9ec2 (patch)
tree4d2713df8cb0dbbb6c0c6f1446347da17aa5ca70 /arch/powerpc/kernel
parent20045f0155ab79f8beb840022ea86bff46167f79 (diff)
powerpc/qspinlock: Fix stale propagated yield_cpu
yield_cpu is a sample of a preempted lock holder that gets propagated back through the queue. Queued waiters use this to yield to the preempted lock holder without continually sampling the lock word (which would defeat the purpose of MCS queueing by bouncing the cache line). The problem is that yield_cpu can become stale. It can take some time to be passed down the chain, and if any queued waiter gets preempted then it will cease to propagate the yield_cpu to later waiters. This can result in yielding to a CPU that no longer holds the lock, which is bad, but particularly if it is currently in H_CEDE (idle), then it appears to be preempted and some hypervisors (PowerVM) can cause very long H_CONFER latencies waiting for H_CEDE wakeup. This results in latency spikes and hard lockups on oversubscribed partitions with lock contention. This is a minimal fix. Before yielding to yield_cpu, sample the lock word to confirm yield_cpu is still the owner, and bail out of it is not. Thanks to a bunch of people who reported this and tracked down the exact problem using tracepoints and dispatch trace logs. Fixes: 28db61e207ea ("powerpc/qspinlock: allow propagation of yield CPU down the queue") Cc: [email protected] # v6.2+ Reported-by: Srikar Dronamraju <[email protected]> Reported-by: Laurent Dufour <[email protected]> Reported-by: Shrikanth Hegde <[email protected]> Debugged-by: "Nysal Jan K.A" <[email protected]> Signed-off-by: Nicholas Piggin <[email protected]> Tested-by: Shrikanth Hegde <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
Diffstat (limited to 'arch/powerpc/kernel')
0 files changed, 0 insertions, 0 deletions