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)
struct amdgpu_sync sync;
int r;
+ if (list_empty(&vm->freed))
+ return 0;
/*
* Implicitly sync to command submissions in the same VM before