Skip to content

Commit 2377427

Browse files
committed
drm/i915: Drop vm.ref for duplicate vma on construction
As we allow for parallel threads to create the same vma instance concurrently, and we only filter out the duplicates upon reacquiring the spinlock for the rbtree, we have to free the loser of the constructors' race. When freeing, we should also drop any resource references acquired for the redundant vma. Fixes: 2850748 ("drm/i915: Pull i915_vma_pin under the vm->mutex") Signed-off-by: Chris Wilson <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Cc: <[email protected]> # v5.5+ Reviewed-by: Tvrtko Ursulin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 8f125da commit 2377427

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/i915/i915_vma.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ vma_create(struct drm_i915_gem_object *obj,
198198
cmp = i915_vma_compare(pos, vm, view);
199199
if (cmp == 0) {
200200
spin_unlock(&obj->vma.lock);
201+
i915_vm_put(vm);
201202
i915_vma_free(vma);
202203
return pos;
203204
}

0 commit comments

Comments
 (0)