diff options
| author | John Stultz <[email protected]> | 2024-11-14 19:00:47 +0000 |
|---|---|---|
| committer | Peter Zijlstra <[email protected]> | 2024-12-02 11:01:29 +0000 |
| commit | 82f9cc094975240885c93effbca7f4603f5de1bf (patch) | |
| tree | 14e03942067d2c618ea37006cccf8a6ec06fefc3 /drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | |
| parent | sched/deadline: Fix warning in migrate_enable for boosted tasks (diff) | |
| download | kernel-82f9cc094975240885c93effbca7f4603f5de1bf.tar.gz kernel-82f9cc094975240885c93effbca7f4603f5de1bf.zip | |
locking: rtmutex: Fix wake_q logic in task_blocks_on_rt_mutex
Anders had bisected a crash using PREEMPT_RT with linux-next and
isolated it down to commit 894d1b3db41c ("locking/mutex: Remove
wakeups from under mutex::wait_lock"), where it seemed the
wake_q structure was somehow getting corrupted causing a null
pointer traversal.
I was able to easily repoduce this with PREEMPT_RT and managed
to isolate down that through various call stacks we were
actually calling wake_up_q() twice on the same wake_q.
I found that in the problematic commit, I had added the
wake_up_q() call in task_blocks_on_rt_mutex() around
__ww_mutex_add_waiter(), following a similar pattern in
__mutex_lock_common().
However, its just wrong. We haven't dropped the lock->wait_lock,
so its contrary to the point of the original patch. And it
didn't match the __mutex_lock_common() logic of re-initializing
the wake_q after calling it midway in the stack.
Looking at it now, the wake_up_q() call is incorrect and should
just be removed. So drop the erronious logic I had added.
Fixes: 894d1b3db41c ("locking/mutex: Remove wakeups from under mutex::wait_lock")
Closes: https://lore.kernel.org/lkml/[email protected]/
Reported-by: Anders Roxell <[email protected]>
Reported-by: Arnd Bergmann <[email protected]>
Signed-off-by: John Stultz <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Juri Lelli <[email protected]>
Tested-by: Anders Roxell <[email protected]>
Tested-by: K Prateek Nayak <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c')
0 files changed, 0 insertions, 0 deletions
