[Intel-gfx] [PATCH 14/19] drm/i915: Add i915_vma_unbind_unlocked, and take obj lock for i915_vma_unbind

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Fri Sep 3 09:33:25 UTC 2021


Op 30-08-2021 om 14:10 schreef Maarten Lankhorst:
> We want to remove more members of i915_vma, which requires the locking to be
> held more often.
>
> Start requiring gem object lock for i915_vma_unbind, as it's one of the
> callers that may unpin pages.
>
> Some special care is needed when evicting, because the last reference to the
> object may be held by the VMA, so after __i915_vma_unbind, vma may be garbage,
> and we need to cache vma->obj before unlocking.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c  |  2 +-
>  drivers/gpu/drm/i915/gem/i915_gem_shrinker.c  | 14 +++-
>  .../gpu/drm/i915/gem/selftests/huge_pages.c   |  4 +-
>  .../i915/gem/selftests/i915_gem_client_blt.c  |  2 +-
>  .../drm/i915/gem/selftests/i915_gem_mman.c    |  6 ++
>  drivers/gpu/drm/i915/gt/intel_ggtt.c          | 46 ++++++++++--
>  drivers/gpu/drm/i915/i915_drv.h               |  7 +-
>  drivers/gpu/drm/i915/i915_gem.c               | 29 +++++++-
>  drivers/gpu/drm/i915/i915_gem_evict.c         | 74 +++++++++++++++++--
>  drivers/gpu/drm/i915/i915_vma.c               | 27 ++++++-
>  drivers/gpu/drm/i915/i915_vma.h               |  1 +
>  drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 22 +++---
>  drivers/gpu/drm/i915/selftests/i915_vma.c     |  2 +-
>  13 files changed, 195 insertions(+), 41 deletions(-)

This patch breaks the selftests because lockdep doesn't like nested trylocks, and eviction needed some love.

I've split it out, and will resubmit this part, rest can still be reviewed as it doesn't affect that.



More information about the Intel-gfx mailing list