drm/amdgpu: skip clearing empty freed VM list on GEM close
authorBob Zhou <bobzhou2@amd.com>
Thu, 16 Jul 2026 02:44:36 +0000 (10:44 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 28 Jul 2026 23:59:08 +0000 (19:59 -0400)
commite3a721753f60c1d4643a729eaf5a8976d285fa0f
tree040cb4b6961a4265f25936327b86b62493a2b1f3
parent17da8410554906a95bb9ef30acbdf0c5abc1a4ef
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 <bobzhou2@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 8ba869e852d4f1b1c0e5ae9225c77f7ceccbe056)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c