public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 0/2] Protect vma destruction with the object lock
@ 2022-07-04 13:52 Thomas Hellström
  2022-07-04 13:52 ` [Intel-gfx] [PATCH 1/2] drm/i915: Take the object lock when destroying vmas from vm destruction Thomas Hellström
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Thomas Hellström @ 2022-07-04 13:52 UTC (permalink / raw)
  To: intel-gfx, dri-devel; +Cc: Thomas Hellström

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(-)

-- 
2.36.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-05 11:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-04 13:52 [Intel-gfx] [PATCH 0/2] Protect vma destruction with the object lock Thomas Hellström
2022-07-04 13:52 ` [Intel-gfx] [PATCH 1/2] drm/i915: Take the object lock when destroying vmas from vm destruction Thomas Hellström
2022-07-04 13:52 ` [Intel-gfx] [PATCH 2/2] drm/i915/gem: Rework i915_gem_object_unbind to rely on the object lock Thomas Hellström
2022-07-04 20:28 ` [Intel-gfx] ✓ Fi.CI.BAT: success for Protect vma destruction with " Patchwork
2022-07-05  1:53 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox