Skip to content

Protect vma destruction with the object lock

Thomas Hellström dri-devel intel-gfx 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2drm/i915: Take the object lock when destroying vmas from vm destructiondrivers/gpu/drm/i915/gt/intel_gtt.c+17 -00 replies
2/2drm/i915/gem: Rework i915_gem_object_unbind to rely on the object lockdrivers/gpu/drm/i915/gem/i915_gem_domain.c drivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gem.c+4 -250 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Protect vma destruction with the object lock

Protecting vma destruction with the object lock is already implemented everywhere as part of the "Remove short-term pinning" work, except in the vm destructor where the reasoning was that most code that needs to keep vmas alive also holds a vm reference.

However this complicates lifetime rules for vmas, so take the object lock around vma destruction also in the vm destructor, trying first with trylock to avoid having to unnecessarily release and re-take the vm mutex that protects the vma lists.

As a follow up remove the now unnecessary taking of the vm reference in i915_gem_object_unbind(), and the "BARRIER" retry when taking that reference fails.

Thomas Hellström (2):
drm/i915: Take the object lock when destroying vmas from vm
destruction
drm/i915/gem: Rework i915_gem_object_unbind to rely on the object lock

 drivers/gpu/drm/i915/gem/i915_gem_domain.c |  4 +---
 drivers/gpu/drm/i915/gt/intel_gtt.c        | 17 +++++++++++++++++
 drivers/gpu/drm/i915/i915_drv.h            |  7 +++----
 drivers/gpu/drm/i915/i915_gem.c            | 18 ------------------
 4 files changed, 21 insertions(+), 25 deletions(-)
Signature · 1 line
2.36.1