public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH v2 0/3] Prepare error capture for asynchronous migration
@ 2021-10-27 10:52 Thomas Hellström
  2021-10-27 10:52 ` [Intel-gfx] [PATCH v2 1/3] drm/i915: Introduce refcounted sg-tables Thomas Hellström
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Thomas Hellström @ 2021-10-27 10:52 UTC (permalink / raw)
  To: intel-gfx, dri-devel
  Cc: maarten.lankhorst, matthew.auld, Thomas Hellström

This patch series prepares error capture for asynchronous migration,
where the vma pages may not reflect the pages the GPU is currently
executing from but may be several migrations ahead.

The first patch deals with refcounting sg-list so that they don't
disappear under the capture code, which typically otherwise happens at
put_pages() time.

The second patch introduces vma state snapshots that record the vma state
at request submission time. It also updates the memory allocation mode to
reflect that error capture may and will happen in the dma-fence signalling
critical path, and finally takes additional measures to make sure that
the capture list and request is not disappearing from under us while
capturing. The latter may otherwise happen if a heartbeat triggered parallel
capture is running during a manual reset which retires the request.

Finally the last patch is more of a POC patch and not strictly needed yet,
but will be (or at least something very similar) soon for async unbinding.
It will make sure that unbinding doesn't complete or signal completion
before capture is done. Async reuse of memory can't happen until unbinding
signals complete and without waiting for capture done, we might capture
contents of reused memory.
Before the last patch the vma active is instead still keeping the vma alive,
but that will not work with async unbinding anymore, and also it is still
not clear how we guarantee keeping the vma alive long enough to even
grab an active reference during capture.

v2: Mostly Fixes for selftests and rebinding. See patch 3. 

Thomas Hellström (3):
  drm/i915: Introduce refcounted sg-tables
  drm/i915: Update error capture code to avoid using the current vma
    state
  drm/i915: Initial introduction of vma resources

 drivers/gpu/drm/i915/Makefile                 |   1 +
 .../gpu/drm/i915/gem/i915_gem_execbuffer.c    | 137 +++++++++---
 drivers/gpu/drm/i915/gem/i915_gem_object.h    |   4 +-
 .../gpu/drm/i915/gem/i915_gem_object_types.h  |   3 +-
 drivers/gpu/drm/i915/gem/i915_gem_shmem.c     |  16 +-
 drivers/gpu/drm/i915/gem/i915_gem_ttm.c       | 188 +++++++++-------
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     |   8 +-
 .../drm/i915/gt/intel_execlists_submission.c  |   2 +-
 drivers/gpu/drm/i915/i915_gpu_error.c         | 180 +++++++++++-----
 drivers/gpu/drm/i915/i915_request.c           |  63 ++++--
 drivers/gpu/drm/i915/i915_request.h           |  18 +-
 drivers/gpu/drm/i915/i915_scatterlist.c       |  62 ++++--
 drivers/gpu/drm/i915/i915_scatterlist.h       |  76 ++++++-
 drivers/gpu/drm/i915/i915_vma.c               | 201 +++++++++++++++++-
 drivers/gpu/drm/i915/i915_vma.h               |  20 +-
 drivers/gpu/drm/i915/i915_vma_snapshot.c      | 131 ++++++++++++
 drivers/gpu/drm/i915/i915_vma_snapshot.h      | 112 ++++++++++
 drivers/gpu/drm/i915/i915_vma_types.h         |   5 +
 drivers/gpu/drm/i915/intel_region_ttm.c       |  15 +-
 drivers/gpu/drm/i915/intel_region_ttm.h       |   5 +-
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c |  99 +++++----
 drivers/gpu/drm/i915/selftests/mock_region.c  |  12 +-
 22 files changed, 1093 insertions(+), 265 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/i915_vma_snapshot.c
 create mode 100644 drivers/gpu/drm/i915/i915_vma_snapshot.h

-- 
2.31.1


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

end of thread, other threads:[~2021-10-28 11:20 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-27 10:52 [Intel-gfx] [PATCH v2 0/3] Prepare error capture for asynchronous migration Thomas Hellström
2021-10-27 10:52 ` [Intel-gfx] [PATCH v2 1/3] drm/i915: Introduce refcounted sg-tables Thomas Hellström
2021-10-27 18:03   ` Matthew Auld
2021-10-28  7:04     ` Thomas Hellström
2021-10-28  8:47       ` Matthew Auld
2021-10-28  9:35         ` Thomas Hellström
2021-10-28  9:58           ` Matthew Auld
2021-10-28 11:20             ` Thomas Hellström
2021-10-27 10:52 ` [Intel-gfx] [PATCH v2 2/3] drm/i915: Update error capture code to avoid using the current vma state Thomas Hellström
2021-10-28  8:46   ` kernel test robot
2021-10-27 10:52 ` [Intel-gfx] [PATCH v2 3/3] drm/i915: Initial introduction of vma resources Thomas Hellström
2021-10-27 22:07   ` kernel test robot
2021-10-27 14:40 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Prepare error capture for asynchronous migration (rev2) Patchwork
2021-10-27 15:13 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-10-27 18:54 ` [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