On 5/7/25 23:39, Philip Yang wrote: > After process exit to unmap csa and free GPU vm, if signal is accepted > and then waiting to take vm lock is interrupted and return, it causes > memory leaking and below warning backtrace. > > Change to use uninterruptible wait lock fix the issue. > > WARNING: CPU: 69 PID: 167800 at amd/amdgpu/amdgpu_kms.c:1525 > amdgpu_driver_postclose_kms+0x294/0x2a0 [amdgpu] > Call Trace: > <TASK> > drm_file_free.part.0+0x1da/0x230 [drm] > drm_close_helper.isra.0+0x65/0x70 [drm] > drm_release+0x6a/0x120 [drm] > amdgpu_drm_release+0x51/0x60 [amdgpu] > __fput+0x9f/0x280 > ____fput+0xe/0x20 > task_work_run+0x67/0xa0 > do_exit+0x217/0x3c0 > do_group_exit+0x3b/0xb0 > get_signal+0x14a/0x8d0 > arch_do_signal_or_restart+0xde/0x100 > exit_to_user_mode_loop+0xc1/0x1a0 > exit_to_user_mode_prepare+0xf4/0x100 > syscall_exit_to_user_mode+0x17/0x40 > do_syscall_64+0x69/0xc0 > > Signed-off-by: Philip Yang <[email protected]>
Reviewed-by: Christian König <[email protected]> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c > index cfdf558b48b6..02138aa55793 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c > @@ -109,7 +109,7 @@ int amdgpu_unmap_static_csa(struct amdgpu_device *adev, > struct amdgpu_vm *vm, > struct drm_exec exec; > int r; > > - drm_exec_init(&exec, DRM_EXEC_INTERRUPTIBLE_WAIT, 0); > + drm_exec_init(&exec, 0, 0); > drm_exec_until_all_locked(&exec) { > r = amdgpu_vm_lock_pd(vm, &exec, 0); > if (likely(!r))
