Skip to content

drm/i915: Asynchronous vma unbinding

Thomas Hellström dri-devel intel-gfx 8 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest6 patches 2 repliesIn review
  2. v66 patches 6 repliesSuperseded
  3. v56 patches 6 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v4 posting 2/24 patches8 repliesSuperseded
v4 posting 1/24 patches0 repliesSuperseded
v37 patches6 repliesSuperseded
v27 patches0 repliesSuperseded
v17 patches1 replySuperseded

Changes in v7 from the cover letter

-- More s/unsigned long/u64/ changes (Matthew Auld)

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6drm/i915: Initial introduction of vma resourcesdrivers/gpu/drm/i915/Makefile drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c drivers/gpu/drm/i915/i915_vma.c +7 more+333 -630 replies
2/6drm/i915: Use the vma resource as argument for gtt binding / unbindingdrivers/gpu/drm/i915/display/intel_dpt.c drivers/gpu/drm/i915/gem/i915_gem_object_types.h drivers/gpu/drm/i915/gem/selftests/huge_pages.c +19 more+314 -2140 replies
3/6drm/i915: Don't pin the object pages during pending vma bindsdrivers/gpu/drm/i915/i915_vma.c+1 -40 replies
4/6drm/i915: Use vma resources for async unbindingdrivers/gpu/drm/i915/gem/i915_gem_ttm_move.c drivers/gpu/drm/i915/gt/intel_ggtt.c drivers/gpu/drm/i915/gt/intel_gtt.c +8 more+579 -672 replies
5/6drm/i915: Asynchronous migration selftestdrivers/gpu/drm/i915/gem/i915_gem_object.c drivers/gpu/drm/i915/gem/i915_gem_object.h drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c+192 -150 replies
6/6drm/i915: Use struct vma_resource instead of struct vma_snapshotdrivers/gpu/drm/i915/Makefile drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c drivers/gpu/drm/i915/gt/intel_engine_cs.c +8 more+90 -3140 replies

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchMatthew Auld
1/6R-b
2/6R-b
3/6R-b
4/6R-b
5/6R-b
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v7 thread

Cover letter [PATCH v7 0/6] drm/i915: Asynchronous vma unbinding

This patch series introduces infrastructure for asynchronous vma unbinding. The single enabled use-case is initially at buffer object migration where we otherwise sync when unbinding vmas before migration. This in theory allows us to pipeline any number of migrations, but in practice the number is restricted by a sync wait when filling the migration context ring. We might want to look at that moving forward if needed.

The other main use-case is to be able to pipeline vma evictions, for example with softpinning where a new vma wants to reuse the vm range of an already active vma. We can't support this just yet because we need dma_resv locking around vma eviction for that, which is under implementation.

Patch 1 introduces vma resource first for error capture purposes Patch 2 changes the vm backend interface to take vma resources rather than vmas Patch 3 removes and unneeded page pinning
Patch 4 introduces the async unbinding itself, and finally
Patch 5 introduces a selftest
Patch 6 realizes we have duplicated functionality and removes the vma snapshots

v2:
-- Some kernel test robot reports addressed.
-- kmem cache for vma resources, See patch 4
-- Various fixes all over the place. See separate commit messages. v3:
-- Re-add a missing i915_vma_resource_put()
-- Remove a stray debug printout
v4:
-- Patch series split in two. This is the second part.
-- Take cache coloring into account when searching for vma_resources
pending unbind. (Matthew Auld)
v5:
-- Add a selftest.
-- Remove page pinning while sync binding.
-- A couple of fixes in i915_vma_resource_bind_dep_await()
v6:
-- Some documentation updates
-- Remove I915_VMA_ALLOC_BIT (Matthew Auld)
-- Change some members of struct i915_vma_resource from unsigned long to u64
(Matthew Auld)
-- Fix up the cache coloring adjustment. (Kernel test robot <[email protected]>) -- Don't allow async unbinding if the vma_res pages are not the same as
the object pages. (Matthew Auld)
v7:
-- More s/unsigned long/u64/ changes (Matthew Auld)

Thomas Hellström (6):
drm/i915: Initial introduction of vma resources
drm/i915: Use the vma resource as argument for gtt binding / unbinding drm/i915: Don't pin the object pages during pending vma binds drm/i915: Use vma resources for async unbinding
drm/i915: Asynchronous migration selftest
drm/i915: Use struct vma_resource instead of struct vma_snapshot

 drivers/gpu/drm/i915/Makefile                 |   2 +-
 drivers/gpu/drm/i915/display/intel_dpt.c      |  27 +-
 .../gpu/drm/i915/gem/i915_gem_execbuffer.c    |  17 +-
 drivers/gpu/drm/i915/gem/i915_gem_object.c    |  12 +
 drivers/gpu/drm/i915/gem/i915_gem_object.h    |   3 +
 .../gpu/drm/i915/gem/i915_gem_object_types.h  |  27 +-
 drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c  |  11 +-
 .../gpu/drm/i915/gem/selftests/huge_pages.c   |  37 +-
 .../drm/i915/gem/selftests/i915_gem_migrate.c | 192 +++++++-
 drivers/gpu/drm/i915/gt/gen6_ppgtt.c          |  19 +-
 drivers/gpu/drm/i915/gt/gen8_ppgtt.c          |  37 +-
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     |   9 +-
 drivers/gpu/drm/i915/gt/intel_ggtt.c          |  72 +--
 drivers/gpu/drm/i915/gt/intel_gtt.c           |   4 +
 drivers/gpu/drm/i915/gt/intel_gtt.h           |  19 +-
 drivers/gpu/drm/i915/gt/intel_ppgtt.c         |  22 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c      |  13 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h      |   2 +-
 drivers/gpu/drm/i915/i915_debugfs.c           |   3 +-
 drivers/gpu/drm/i915/i915_drv.h               |   1 +
 drivers/gpu/drm/i915/i915_gem.c               |  12 +-
 drivers/gpu/drm/i915/i915_gpu_error.c         |  87 ++--
 drivers/gpu/drm/i915/i915_module.c            |   3 +
 drivers/gpu/drm/i915/i915_request.c           |  12 +-
 drivers/gpu/drm/i915/i915_request.h           |   6 +-
 drivers/gpu/drm/i915/i915_vma.c               | 241 +++++++++-
 drivers/gpu/drm/i915/i915_vma.h               |  33 +-
 drivers/gpu/drm/i915/i915_vma_resource.c      | 417 ++++++++++++++++++
 drivers/gpu/drm/i915/i915_vma_resource.h      | 234 ++++++++++
 drivers/gpu/drm/i915/i915_vma_snapshot.c      | 134 ------
 drivers/gpu/drm/i915/i915_vma_snapshot.h      | 112 -----
 drivers/gpu/drm/i915/i915_vma_types.h         |  19 +-
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 159 ++++---
 drivers/gpu/drm/i915/selftests/mock_gtt.c     |  12 +-
 34 files changed, 1421 insertions(+), 589 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/i915_vma_resource.c
 create mode 100644 drivers/gpu/drm/i915/i915_vma_resource.h
 delete mode 100644 drivers/gpu/drm/i915/i915_vma_snapshot.c
 delete mode 100644 drivers/gpu/drm/i915/i915_vma_snapshot.h
Signature · 1 line
2.31.1