Skip to content
Commit 894d1b3d authored by Peter Zijlstra's avatar Peter Zijlstra
Browse files

locking/mutex: Remove wakeups from under mutex::wait_lock



In preparation to nest mutex::wait_lock under rq::lock we need
to remove wakeups from under it.

Do this by utilizing wake_qs to defer the wakeup until after the
lock is dropped.

[Heavily changed after 55f036ca ("locking: WW mutex cleanup") and
08295b3b ("locking: Implement an algorithm choice for Wound-Wait
mutexes")]
[jstultz: rebased to mainline, added extra wake_up_q & init
 to avoid hangs, similar to Connor's rework of this patch]

Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarJuri Lelli <juri.lelli@redhat.com>
Signed-off-by: default avatarJohn Stultz <jstultz@google.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Metin Kaya's avatarMetin Kaya <metin.kaya@arm.com>
Acked-by: default avatarDavidlohr Bueso <dave@stgolabs.net>
Tested-by: default avatarK Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: Metin Kaya's avatarMetin Kaya <metin.kaya@arm.com>
Link: https://lore.kernel.org/r/20241009235352.1614323-2-jstultz@google.com
parent 7e019dcc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment