mirror_ubuntu-kernels/drivers/gpu/drm/i915/gem
Chris Wilson ad765fae79 drm/i915/gem: Look for waitboosting across the whole object prior to individual waits
We employ a "waitboost" heuristic to detect when userspace is stalled
waiting for results from earlier execution. Under latency sensitive work
mixed between the gpu/cpu, the GPU is typically under-utilised and so
RPS sees that low utilisation as a reason to downclock the frequency,
causing longer stalls and lower throughput. The user left waiting for
the results is not impressed.

On applying commit 047a1b877e ("dma-buf & drm/amdgpu: remove dma_resv
workaround") it was observed that deinterlacing h264 on Haswell
performance dropped by 2-5x. The reason being that the natural workload
was not intense enough to trigger RPS (using HW evaluation intervals) to
upclock, and so it was depending on waitboosting for the throughput.

Commit 047a1b877e ("dma-buf & drm/amdgpu: remove dma_resv workaround")
changes the composition of dma-resv from keeping a single write fence +
multiple read fences, to a single array of multiple write and read
fences (a maximum of one pair of write/read fences per context). The
iteration order was also changed implicitly from all-read fences then
the single write fence, to a mix of write fences followed by read
fences. It is that ordering change that belied the fragility of
waitboosting.

Currently, a waitboost is inspected at the point of waiting on an
outstanding fence. If the GPU is backlogged such that we haven't yet
stated the request we need to wait on, we force the GPU to upclock until
the completion of that request. By changing the order in which we waited
upon requests, we ended up waiting on those requests in sequence and as
such we saw that each request was already started and so not a suitable
candidate for waitboosting.

Instead of asking whether to boost each fence in turn, we can look at
whether boosting is required for the dma-resv ensemble prior to waiting
on any fence, making the heuristic more robust to the order in which
fences are stored in the dma-resv.

Reported-by: Thomas Voegtle <tv@lio96.de>
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6284
Fixes: 047a1b877e ("dma-buf & drm/amdgpu: remove dma_resv workaround")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Karolina Drobnik <karolina.drobnik@intel.com>
Tested-by: Thomas Voegtle <tv@lio96.de>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/07e05518d9f6620d20cc1101ec1849203fe973f9.1657289332.git.karolina.drobnik@intel.com
(cherry picked from commit 394e2b57a9)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2022-07-12 18:21:55 -04:00
..
selftests Merge tag 'drm-intel-gt-next-2022-04-27' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2022-04-28 15:32:29 +10:00
i915_gem_busy.c dma-buf: specify usage while adding fences to dma_resv obj v7 2022-04-07 12:53:53 +02:00
i915_gem_clflush.c dma-buf: add DMA_RESV_USAGE_KERNEL v3 2022-04-07 12:53:54 +02:00
i915_gem_clflush.h
i915_gem_context_types.h drm/i915: Fixup kerneldoc in struct i915_gem_context 2022-04-06 08:33:40 +01:00
i915_gem_context.c drm/i915/gem: add missing else 2022-06-27 18:12:03 +03:00
i915_gem_context.h drm/i915/gem: Use to_gt() helper for GGTT accesses 2022-01-05 10:43:36 -08:00
i915_gem_create.c drm/i915: add i915_gem_object_create_region_at() 2022-03-16 17:50:34 +00:00
i915_gem_create.h drm/i915: split out gem/i915_gem_create.h from i915_drv.h 2022-02-11 14:43:28 +02:00
i915_gem_dmabuf.c drm/i915/dmabuf: Fix prime_mmap to work when using LMEM 2022-03-07 00:09:13 +05:30
i915_gem_dmabuf.h drm/i915: split out gem/i915_gem_dmabuf.h from i915_drv.h 2022-02-11 13:50:37 +02:00
i915_gem_domain.c drm/i915: tweak the ordering in cpu_write_needs_clflush 2022-06-27 18:12:10 +03:00
i915_gem_domain.h drm/i915: split out gem/i915_gem_domain.h from i915_drv.h 2022-02-14 11:25:52 +02:00
i915_gem_execbuffer.c drm/i915: Individualize fences before adding to dma_resv obj 2022-06-13 13:04:40 +03:00
i915_gem_internal.c drm/i915: split out i915_gem_internal.h from i915_drv.h 2022-02-11 12:52:50 +02:00
i915_gem_internal.h drm/i915: split out i915_gem_internal.h from i915_drv.h 2022-02-11 12:52:50 +02:00
i915_gem_ioctls.h
i915_gem_lmem.c Merge tag 'drm-intel-gt-next-2022-04-27' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2022-04-28 15:32:29 +10:00
i915_gem_lmem.h
i915_gem_mman.c drm/i915: Sunset igpu legacy mmap support based on GRAPHICS_VER_FULL 2022-04-11 09:11:21 +03:00
i915_gem_mman.h
i915_gem_object_types.h drm/i915/ttm: wire up the object offset 2022-03-16 17:50:38 +00:00
i915_gem_object.c Merge tag 'drm-intel-gt-next-2022-04-27' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2022-04-28 15:32:29 +10:00
i915_gem_object.h drm/i915: drop bo->moving dependency 2022-04-07 12:53:54 +02:00
i915_gem_pages.c drm/i915: add I915_BO_ALLOC_GPU_ONLY 2022-02-28 08:47:34 +00:00
i915_gem_phys.c drm/i915: move i915_gem_object_needs_bit17_swizzle() to i915_gem_tiling.[ch] 2022-03-17 11:35:36 +02:00
i915_gem_pm.c Merge tag 'drm-intel-gt-next-2022-02-17' of git://anongit.freedesktop.org/drm/drm-intel into drm-intel-next 2022-02-23 15:03:51 -05:00
i915_gem_pm.h
i915_gem_region.c Merge drm/drm-next into drm-intel-gt-next 2022-04-21 13:48:26 -04:00
i915_gem_region.h drm/i915: add i915_gem_object_create_region_at() 2022-03-16 17:50:34 +00:00
i915_gem_shmem.c drm for 5.19-rc1 2022-05-25 16:18:27 -07:00
i915_gem_shrinker.c drm/i915: clean up shrinker_release_pages 2022-01-10 10:49:50 +00:00
i915_gem_shrinker.h
i915_gem_stolen.c Merge drm/drm-next into drm-intel-gt-next 2022-04-21 13:48:26 -04:00
i915_gem_stolen.h drm/i915: add i915_gem_object_create_region_at() 2022-03-16 17:50:34 +00:00
i915_gem_throttle.c drm/i915: split out i915_file_private.h from i915_drv.h 2022-02-14 13:16:28 +02:00
i915_gem_tiling.c drm/i915: move i915_gem_object_needs_bit17_swizzle() to i915_gem_tiling.[ch] 2022-03-17 11:35:36 +02:00
i915_gem_tiling.h drm/i915: move i915_gem_object_needs_bit17_swizzle() to i915_gem_tiling.[ch] 2022-03-17 11:35:36 +02:00
i915_gem_ttm_move.c drm/i915: drop bo->moving dependency 2022-04-07 12:53:54 +02:00
i915_gem_ttm_move.h drm/i915: Break out the i915_deps utility 2021-12-22 08:52:57 +01:00
i915_gem_ttm_pm.c
i915_gem_ttm_pm.h
i915_gem_ttm.c drm/i915/ttm: fix sg_table construction 2022-07-12 18:21:45 -04:00
i915_gem_ttm.h drm/i915: add i915_gem_object_create_region_at() 2022-03-16 17:50:34 +00:00
i915_gem_userptr.c dma-buf: add DMA_RESV_USAGE_BOOKKEEP v3 2022-04-07 12:53:54 +02:00
i915_gem_userptr.h drm/i915: split out gem/i915_gem_userptr.h from i915_drv.h 2022-01-10 15:43:19 +02:00
i915_gem_wait.c drm/i915/gem: Look for waitboosting across the whole object prior to individual waits 2022-07-12 18:21:55 -04:00
i915_gemfs.c drm/i915: Move intel_vtd_active and run_as_guest to i915_utils 2022-03-30 12:04:01 +01:00
i915_gemfs.h