mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-12-26 19:12:39 +00:00
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>
|
||
|---|---|---|
| .. | ||
| cik_event_interrupt.c | ||
| cik_int.h | ||
| cik_regs.h | ||
| cwsr_trap_handler_gfx8.asm | ||
| cwsr_trap_handler_gfx9.asm | ||
| cwsr_trap_handler_gfx10.asm | ||
| cwsr_trap_handler.h | ||
| Kconfig | ||
| kfd_chardev.c | ||
| kfd_crat.c | ||
| kfd_crat.h | ||
| kfd_debugfs.c | ||
| kfd_device_queue_manager_cik.c | ||
| kfd_device_queue_manager_v9.c | ||
| kfd_device_queue_manager_v10.c | ||
| kfd_device_queue_manager_v11.c | ||
| kfd_device_queue_manager_vi.c | ||
| kfd_device_queue_manager.c | ||
| kfd_device_queue_manager.h | ||
| kfd_device.c | ||
| kfd_doorbell.c | ||
| kfd_events.c | ||
| kfd_events.h | ||
| kfd_flat_memory.c | ||
| kfd_int_process_v9.c | ||
| kfd_int_process_v11.c | ||
| kfd_interrupt.c | ||
| kfd_iommu.c | ||
| kfd_iommu.h | ||
| kfd_kernel_queue.c | ||
| kfd_kernel_queue.h | ||
| kfd_migrate.c | ||
| kfd_migrate.h | ||
| kfd_module.c | ||
| kfd_mqd_manager_cik.c | ||
| kfd_mqd_manager_v9.c | ||
| kfd_mqd_manager_v10.c | ||
| kfd_mqd_manager_v11.c | ||
| kfd_mqd_manager_vi.c | ||
| kfd_mqd_manager.c | ||
| kfd_mqd_manager.h | ||
| kfd_packet_manager_v9.c | ||
| kfd_packet_manager_vi.c | ||
| kfd_packet_manager.c | ||
| kfd_pasid.c | ||
| kfd_pm4_headers_ai.h | ||
| kfd_pm4_headers_aldebaran.h | ||
| kfd_pm4_headers_diq.h | ||
| kfd_pm4_headers_vi.h | ||
| kfd_pm4_headers.h | ||
| kfd_pm4_opcodes.h | ||
| kfd_priv.h | ||
| kfd_process_queue_manager.c | ||
| kfd_process.c | ||
| kfd_queue.c | ||
| kfd_smi_events.c | ||
| kfd_smi_events.h | ||
| kfd_svm.c | ||
| kfd_svm.h | ||
| kfd_topology.c | ||
| kfd_topology.h | ||
| Makefile | ||
| soc15_int.h | ||