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-05 20:36:11 +02:00
2022-06-03 11:48:47 -07:00
2022-06-05 17:14:03 -07:00
2022-06-30 08:21:43 +09:00
2022-07-01 21:04:15 +02:00
2022-07-01 10:00:50 +02:00
2022-06-26 14:12:56 -07:00
2022-07-13 10:54:56 +10:00
2022-06-09 15:34:08 -07:00
2022-06-08 12:27:08 +00:00
2022-06-10 15:21:23 +02:00
2022-06-28 17:56:57 +02:00
2022-07-06 20:04:06 -07:00
2022-06-28 22:03:18 -07:00
2022-07-08 04:32:26 +09:00
2022-07-06 10:53:25 +05:30
2022-07-14 14:41:30 +02:00
2022-06-17 10:43:20 +02:00
2022-07-04 10:41:59 -07:00
2022-07-07 12:18:18 +02:00
2022-07-25 09:31:05 -04:00
2022-06-08 12:28:13 +00:00
2022-06-10 08:41:28 +00:00
2022-07-01 11:53:29 -07:00
2022-07-07 23:06:34 +02:00
2022-06-08 18:05:45 +02:00
2022-06-20 09:49:52 +02:00
2022-06-24 16:41:03 -03:00
2022-06-07 15:00:29 -07:00
2022-06-03 11:36:34 -07:00
2022-07-06 12:59:21 +02:00
2022-07-10 08:52:12 -07:00
2022-06-02 15:23:54 -07:00
2022-06-29 19:48:04 -04:00
2022-06-03 11:17:49 -07:00
2022-06-06 11:18:20 +02:00
2022-06-02 15:23:54 -07:00
2022-07-02 16:20:56 +02:00
2022-06-15 10:05:56 -07:00
2022-06-16 16:46:08 +02:00
2022-07-07 10:08:20 -07:00
2022-06-29 14:05:00 +01:00
2022-06-24 11:57:19 -07:00
2022-07-06 19:12:56 +02:00
2022-06-03 11:48:47 -07:00
2022-06-02 15:23:54 -07:00
2022-06-28 16:12:40 +02:00
2022-06-29 09:32:06 -07:00
2022-06-03 11:36:34 -07:00
2022-06-07 20:38:09 +01:00
2022-06-03 11:48:47 -07:00
2022-06-02 15:23:54 -07:00
2022-07-01 11:19:14 -07:00
2022-06-27 22:43:57 -04:00
2022-06-03 11:48:47 -07:00
2022-07-04 14:26:51 +02:00
2022-06-20 11:35:43 +01:00
2022-07-01 09:58:58 +02:00
2022-07-01 13:00:47 -07:00
2022-06-03 11:17:49 -07:00
2022-06-23 19:11:28 +02:00
2022-06-16 21:32:09 -04:00
2022-06-24 13:45:23 +02:00
2022-06-24 02:49:48 -04:00
2022-06-27 11:10:32 +02:00
2022-06-27 08:05:35 -04:00
2022-07-13 10:54:56 +10:00
2022-06-03 11:36:34 -07:00
2022-06-27 08:05:35 -04:00
2022-06-09 12:20:34 +02:00
2022-06-23 15:29:18 +02:00
2022-06-05 09:25:12 -07:00
2022-06-05 09:25:12 -07:00