Philip Yang
74097f9fd2
drm/amdkfd: Process notifier release callback don't take mutex
Move process queues cleanup to deferred work kfd_process_wq_release, to
avoid potential deadlock circular locking warning:
WARNING: possible circular locking dependency detected
the existing dependency chain (in reverse order) is:
-> #2
((work_completion)(&svms->deferred_list_work)){+.+.}-{0:0}:
__flush_work+0x343/0x4a0
svm_range_list_lock_and_flush_work+0x39/0xc0
svm_range_set_attr+0xe8/0x1080 [amdgpu]
kfd_ioctl+0x19b/0x600 [amdgpu]
__x64_sys_ioctl+0x81/0xb0
do_syscall_64+0x34/0x80
entry_SYSCALL_64_after_hwframe+0x44/0xae
-> #1 (&info->lock#2){+.+.}-{3:3}:
__mutex_lock+0xa4/0x940
amdgpu_amdkfd_gpuvm_acquire_process_vm+0x2e3/0x590
kfd_process_device_init_vm+0x61/0x200 [amdgpu]
kfd_ioctl_acquire_vm+0x83/0xb0 [amdgpu]
kfd_ioctl+0x19b/0x600 [amdgpu]
__x64_sys_ioctl+0x81/0xb0
do_syscall_64+0x34/0x80
entry_SYSCALL_64_after_hwframe+0x44/0xae
-> #0 (&process->mutex){+.+.}-{3:3}:
__lock_acquire+0x1365/0x23d0
lock_acquire+0xc9/0x2e0
__mutex_lock+0xa4/0x940
kfd_process_notifier_release+0x96/0xe0 [amdgpu]
__mmu_notifier_release+0x94/0x210
exit_mmap+0x35/0x1f0
mmput+0x63/0x120
svm_range_deferred_list_work+0x177/0x2c0 [amdgpu]
process_one_work+0x2a4/0x600
worker_thread+0x39/0x3e0
kthread+0x16d/0x1a0
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock((work_completion)(&svms->deferred_list_work));
lock(&info->lock#2);
lock((work_completion)(&svms->deferred_list_work));
lock(&process->mutex);
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2022-07-25 09:31:05 -04:00
..
2022-07-25 09:31:05 -04:00
2022-07-05 21:14:02 +03:00
2022-07-05 21:14:02 +03:00
2022-06-20 23:53:55 +03:00
2022-06-27 11:10:43 +02:00
2022-07-05 21:15:13 +03:00
2022-07-06 17:08:03 +02:00
2022-07-05 21:14:02 +03:00
2022-05-17 12:20:04 +10:00
2022-07-13 14:17:35 +10:00
2022-06-20 23:53:55 +03:00
2022-06-20 23:53:55 +03:00
2022-06-20 23:53:55 +03:00
2022-07-05 21:14:02 +03:00
2022-06-22 16:07:38 +02:00
2022-07-05 21:15:23 +03:00
2022-07-12 13:27:57 +10:00
2022-07-05 21:15:13 +03:00
2022-07-05 21:15:13 +03:00
2022-07-05 21:14:02 +03:00
2022-06-24 17:23:38 +02:00
2022-07-05 21:15:23 +03:00
2022-07-12 17:01:42 +10:00
2022-06-20 23:53:55 +03:00
2022-07-14 15:14:45 +02:00
2022-07-13 10:55:53 +10:00
2022-07-05 21:15:13 +03:00
2022-07-13 13:57:15 +10:00
2022-07-05 21:14:02 +03:00
2022-07-05 21:15:23 +03:00
2022-06-15 19:12:17 +02:00
2022-07-05 21:15:13 +03:00
2022-06-20 23:53:55 +03:00
2022-05-21 18:02:47 +02:00
2022-07-25 09:31:02 -04:00
2022-07-05 21:15:13 +03:00
2022-07-05 21:15:13 +03:00
2022-07-12 11:07:32 +10:00
2022-06-28 18:53:20 -04:00
2022-06-24 21:45:28 +02:00
2022-06-20 23:53:55 +03:00
2022-06-20 23:53:55 +03:00
2022-07-05 21:15:23 +03:00
2022-07-05 21:15:13 +03:00
2022-07-13 10:54:56 +10:00
2022-07-12 16:50:05 +10:00
2022-06-27 13:45:53 +02:00
2022-07-05 21:15:13 +03:00
2022-07-05 21:14:02 +03:00
2022-06-27 11:07:55 +02:00
2022-07-13 10:54:56 +10:00
2022-06-20 23:53:55 +03:00
2022-06-20 23:53:55 +03:00
2022-06-12 22:10:50 -01:00
2022-06-20 23:53:55 +03:00
2022-07-13 10:54:56 +10:00
2022-06-20 23:53:55 +03:00
2022-06-20 23:53:55 +03:00
2022-07-05 21:14:02 +03:00
2022-07-13 10:54:56 +10:00
2022-07-06 22:54:51 +03:00
2022-07-09 11:12:05 -07:00
2022-06-27 11:10:43 +02:00
2022-06-20 23:53:55 +03:00
2022-06-20 23:53:55 +03:00
2022-06-20 23:53:55 +03:00
2022-06-28 07:56:32 +02:00
2022-06-21 08:52:59 -07:00
2022-07-05 21:15:13 +03:00
2022-06-20 23:53:55 +03:00
2022-05-04 14:09:34 +02:00
2022-07-05 21:14:02 +03:00
2022-06-20 23:53:55 +03:00
2022-06-30 10:50:59 +03:00
2022-06-20 23:53:55 +03:00
2022-06-20 23:53:55 +03:00
2022-06-30 10:50:59 +03:00
2022-05-13 18:55:13 +03:00
2022-06-30 10:51:12 +03:00
2022-05-25 17:39:49 +02:00
2022-06-27 11:10:43 +02:00
2022-05-05 08:54:09 +02:00
2022-06-20 23:53:55 +03:00
2022-06-08 17:36:15 +02:00
2022-05-19 19:25:23 +02:00
2022-05-19 19:25:19 +02:00
2022-06-22 09:23:08 +02:00
2022-06-20 23:53:55 +03:00
2022-05-05 09:04:10 +02:00
2022-07-05 21:14:02 +03:00
2022-04-25 11:19:36 +02:00
2022-06-20 23:53:55 +03:00
2022-07-05 21:14:02 +03:00
2022-06-20 23:53:55 +03:00
2022-07-05 21:15:13 +03:00
2022-07-13 10:54:56 +10:00
2022-04-28 16:13:04 +01:00
2022-06-22 09:22:05 +02:00
2022-06-30 10:51:03 +03:00
2022-06-27 11:10:43 +02:00
2022-06-13 08:54:16 +02:00
2022-06-03 20:09:27 +08:00
2022-06-20 23:53:55 +03:00
2022-06-27 13:45:53 +02:00
2022-06-29 01:44:48 +02:00