drm/amdgpu: skip clearing empty freed VM list on GEM close
Subsystems (2)
PATCH v2 1/1 drm/amdgpu: skip clearing empty freed VM list on GEM close
amdgpu_vm_clear_freed() allocates an amdgpu_sync object and walks the VM reservation fences via amdgpu_sync_resv() before checking whether vm->freed has anything to clear. Return early when the list is empty to skip this overhead on a hot path (every GEM close and command submission).
Signed-off-by Bob Zhou <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2 -0
@@ -1553,6 +1553,8 @@ int amdgpu_vm_clear_freed(struct amdgpu_device *adev,struct amdgpu_sync sync;int r; +if (list_empty (&vm->freed)) +return 0 ;/* * Implicitly sync to command submissions in the same VM before
Signature · 1 line
2.34.1
Quoted 6 lines · Bob Zhou
amdgpu_vm_clear_freed()allocates anamdgpu_syncobject and walks the VM reservation fences viaamdgpu_sync_resv()before checking whethervm->freedhas anything to clear. Return early when the list is empty to skip this overhead on a hot path (every GEM close and command submission).Signed-off-by Bob Zhou <[email protected]>
Reviewed-by Felix Kuehling <[email protected]>
Quoted 17 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2
-0@@ -1553,6 +1553,8 @@ int amdgpu_vm_clear_freed(struct amdgpu_device *adev,struct amdgpu_sync sync;int r; +if (list_empty (&vm->freed)) +return 0 ;/* * Implicitly sync to command submissions in the same VM before