drm/amdkfd: not restore userptr buffer if kfd process has been removed
Subsystems (3)
PATCH 1/1 drm/amdkfd: not restore userptr buffer if kfd process has been removed
From: Xiaogang Chen <[email protected]>
When kfd process has been terminated not restore userptr buffer after mmu notifier invalidates a range.
Signed-off-by Xiaogang Chen<[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +7 -4
@@ -2524,11 +2524,14 @@ int amdgpu_amdkfd_evict_userptr(struct mmu_interval_notifier *mni,/* First eviction, stop the queues */ r =kgd2kfd_quiesce_mm (mni->mm,KFD_QUEUE_EVICTION_TRIGGER_USERPTR ); -if (r) + +if (r && r != -ESRCH ) {pr_err ("Failed to quiesce KFD\n" ); -queue_delayed_work (system_freezable_wq, - &process_info->restore_userptr_work, -msecs_to_jiffies (AMDGPU_USERPTR_RESTORE_DELAY_MS )); + +queue_delayed_work (system_freezable_wq, + &process_info->restore_userptr_work, +msecs_to_jiffies (AMDGPU_USERPTR_RESTORE_DELAY_MS )); + } }mutex_unlock (&process_info->notifier_lock);
Signature · 1 line
2.25.1
sent a wrong version, please ignore it
Quoted 33 lines · Xiaogang.Chen
From: Xiaogang Chen <[email protected]>
When kfd process has been terminated not restore userptr buffer after mmu notifier invalidates a range.
Signed-off-by Xiaogang Chen<[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +7
-4@@ -2524,11 +2524,14 @@ int amdgpu_amdkfd_evict_userptr(struct mmu_interval_notifier *mni,/* First eviction, stop the queues */ r =kgd2kfd_quiesce_mm (mni->mm,KFD_QUEUE_EVICTION_TRIGGER_USERPTR ); -if (r) + +if (r && r != -ESRCH ) {pr_err ("Failed to quiesce KFD\n" ); -queue_delayed_work (system_freezable_wq, - &process_info->restore_userptr_work, -msecs_to_jiffies (AMDGPU_USERPTR_RESTORE_DELAY_MS )); + +queue_delayed_work (system_freezable_wq, + &process_info->restore_userptr_work, +msecs_to_jiffies (AMDGPU_USERPTR_RESTORE_DELAY_MS )); + } }mutex_unlock (&process_info->notifier_lock);