All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/21] Fix performance regressions with TLB and add GuC support
@ 2022-07-14 12:06 ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 144+ messages in thread
From: Mauro Carvalho Chehab @ 2022-07-14 12:06 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Christian König, Daniel Vetter,
	David Airlie, Sumit Semwal, dri-devel, intel-gfx, linaro-mm-sig,
	linux-kernel, linux-media

TLB invalidation is a slow operation. It should not be doing lightly, as it
causes performance regressions, like this:

[178.821002] i915 0000:00:02.0: [drm] *ERROR* rcs0 TLB invalidation did not complete in 4ms!

This series contain 

1) some patches that makes TLB invalidation to happen only on
active, non-wedged engines, doing cache invalidation in batch 
and only when GT objects are exposed to userspace:

  drm/i915/gt: Ignore TLB invalidations on idle engines
  drm/i915/gt: Only invalidate TLBs exposed to user manipulation
  drm/i915/gt: Skip TLB invalidations once wedged
  drm/i915/gt: Batch TLB invalidations
  drm/i915/gt: Move TLB invalidation to its own file

2) It fixes two bugs, being the first a workaround:

  drm/i915/gt: Invalidate TLB of the OA unit at TLB invalidations
  drm/i915: Invalidate the TLBs on each GT

  drm/i915/guc: Introduce TLB_INVALIDATION_ALL action

3) It adds GuC support. Besides providing TLB invalidation on some
additional hardware, this should also help serializing GuC operations
with TLB invalidation:

  drm/i915/guc: Introduce TLB_INVALIDATION_ALL action
  drm/i915/guc: Define CTB based TLB invalidation routines
  drm/i915: Add platform macro for selective tlb flush
  drm/i915: Define GuC Based TLB invalidation routines
  drm/i915: Add generic interface for tlb invalidation for XeHP
  drm/i915: Use selective tlb invalidations where supported

4) It adds the corresponding kernel-doc markups for the kAPI
used for TLB invalidation.

While I could have split this into smaller pieces, I'm opting to send
them altogether, in order for CI trybot to better verify what issues
will be closed with this series.

---

v2:
  - no changes. Just rebased on the top of drm-tip: 2022y-07m-14d-08h-35m-36s,
   as CI trybot was having troubles applying it. Hopefully, it will now work.

Chris Wilson (7):
  drm/i915/gt: Ignore TLB invalidations on idle engines
  drm/i915/gt: Invalidate TLB of the OA unit at TLB invalidations
  drm/i915/gt: Only invalidate TLBs exposed to user manipulation
  drm/i915/gt: Skip TLB invalidations once wedged
  drm/i915/gt: Batch TLB invalidations
  drm/i915/gt: Move TLB invalidation to its own file
  drm/i915: Invalidate the TLBs on each GT

Mauro Carvalho Chehab (8):
  drm/i915/gt: document with_intel_gt_pm_if_awake()
  drm/i915/gt: describe the new tlb parameter at i915_vma_resource
  drm/i915/guc: use kernel-doc for enum intel_guc_tlb_inval_mode
  drm/i915/guc: document the TLB invalidation struct members
  drm/i915: document tlb field at struct drm_i915_gem_object
  drm/i915/gt: document TLB cache invalidation functions
  drm/i915/guc: describe enum intel_guc_tlb_invalidation_type
  drm/i915/guc: document TLB cache invalidation functions

Piotr Piórkowski (1):
  drm/i915/guc: Introduce TLB_INVALIDATION_ALL action

Prathap Kumar Valsan (5):
  drm/i915/guc: Define CTB based TLB invalidation routines
  drm/i915: Add platform macro for selective tlb flush
  drm/i915: Define GuC Based TLB invalidation routines
  drm/i915: Add generic interface for tlb invalidation for XeHP
  drm/i915: Use selective tlb invalidations where supported

 drivers/gpu/drm/i915/Makefile                 |   1 +
 .../gpu/drm/i915/gem/i915_gem_object_types.h  |   6 +-
 drivers/gpu/drm/i915/gem/i915_gem_pages.c     |  28 +-
 drivers/gpu/drm/i915/gt/intel_engine.h        |   1 +
 drivers/gpu/drm/i915/gt/intel_gt.c            | 125 +-------
 drivers/gpu/drm/i915/gt/intel_gt.h            |   2 -
 .../gpu/drm/i915/gt/intel_gt_buffer_pool.h    |   3 +-
 drivers/gpu/drm/i915/gt/intel_gt_defines.h    |  11 +
 drivers/gpu/drm/i915/gt/intel_gt_pm.h         |  10 +
 drivers/gpu/drm/i915/gt/intel_gt_regs.h       |   8 +
 drivers/gpu/drm/i915/gt/intel_gt_types.h      |  22 +-
 drivers/gpu/drm/i915/gt/intel_ppgtt.c         |   8 +-
 drivers/gpu/drm/i915/gt/intel_tlb.c           | 295 ++++++++++++++++++
 drivers/gpu/drm/i915/gt/intel_tlb.h           |  30 ++
 .../gpu/drm/i915/gt/uc/abi/guc_actions_abi.h  |  54 ++++
 drivers/gpu/drm/i915/gt/uc/intel_guc.c        | 232 ++++++++++++++
 drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  36 +++
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |  24 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h   |   9 +
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c |  91 +++++-
 drivers/gpu/drm/i915/i915_drv.h               |   4 +-
 drivers/gpu/drm/i915/i915_pci.c               |   1 +
 drivers/gpu/drm/i915/i915_vma.c               |  46 ++-
 drivers/gpu/drm/i915/i915_vma.h               |   2 +
 drivers/gpu/drm/i915/i915_vma_resource.c      |   9 +-
 drivers/gpu/drm/i915/i915_vma_resource.h      |   6 +-
 drivers/gpu/drm/i915/intel_device_info.h      |   1 +
 27 files changed, 910 insertions(+), 155 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/gt/intel_gt_defines.h
 create mode 100644 drivers/gpu/drm/i915/gt/intel_tlb.c
 create mode 100644 drivers/gpu/drm/i915/gt/intel_tlb.h

-- 
2.36.1



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

end of thread, other threads:[~2022-08-02  7:48 UTC | newest]

Thread overview: 144+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-14 12:06 [PATCH v2 00/21] Fix performance regressions with TLB and add GuC support Mauro Carvalho Chehab
2022-07-14 12:06 ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06 ` Mauro Carvalho Chehab
2022-07-14 12:06 ` [PATCH v2 01/21] drm/i915/gt: Ignore TLB invalidations on idle engines Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-18 13:16   ` Tvrtko Ursulin
2022-07-18 13:16     ` [Intel-gfx] " Tvrtko Ursulin
2022-07-18 13:16     ` Tvrtko Ursulin
2022-07-18 14:53     ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-18 14:53       ` Mauro Carvalho Chehab
2022-07-18 15:01       ` Tvrtko Ursulin
2022-07-18 15:01         ` Tvrtko Ursulin
2022-07-18 15:50       ` David Laight
2022-07-18 15:50         ` David Laight
2022-07-18 15:50         ` David Laight
2022-07-19  7:24         ` Tvrtko Ursulin
2022-07-19  7:24           ` Tvrtko Ursulin
2022-07-19  7:45           ` David Laight
2022-07-19  7:45             ` David Laight
2022-07-19  7:45             ` David Laight
2022-07-22 11:56   ` Andi Shyti
2022-07-22 11:56     ` Andi Shyti
2022-07-22 11:56     ` [Intel-gfx] " Andi Shyti
2022-07-14 12:06 ` [PATCH v2 02/21] drm/i915/gt: document with_intel_gt_pm_if_awake() Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-18 13:21   ` Tvrtko Ursulin
2022-07-18 13:21     ` [Intel-gfx] " Tvrtko Ursulin
2022-07-18 13:21     ` Tvrtko Ursulin
2022-07-14 12:06 ` [PATCH v2 03/21] drm/i915/gt: Invalidate TLB of the OA unit at TLB invalidations Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-18 13:24   ` Tvrtko Ursulin
2022-07-18 13:24     ` [Intel-gfx] " Tvrtko Ursulin
2022-07-18 13:24     ` Tvrtko Ursulin
2022-07-22 11:57   ` Andi Shyti
2022-07-22 11:57     ` Andi Shyti
2022-07-22 11:57     ` [Intel-gfx] " Andi Shyti
2022-07-14 12:06 ` [PATCH v2 04/21] drm/i915/gt: Only invalidate TLBs exposed to user manipulation Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-18 13:39   ` Tvrtko Ursulin
2022-07-18 13:39     ` [Intel-gfx] " Tvrtko Ursulin
2022-07-18 13:39     ` Tvrtko Ursulin
2022-07-18 16:00     ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-18 16:00       ` Mauro Carvalho Chehab
2022-07-22 11:58   ` Andi Shyti
2022-07-22 11:58     ` [Intel-gfx] " Andi Shyti
2022-07-22 11:58     ` Andi Shyti
2022-07-14 12:06 ` [PATCH v2 05/21] drm/i915/gt: Skip TLB invalidations once wedged Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-18 13:45   ` Tvrtko Ursulin
2022-07-18 13:45     ` [Intel-gfx] " Tvrtko Ursulin
2022-07-18 13:45     ` Tvrtko Ursulin
2022-07-18 16:06     ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-18 16:06       ` Mauro Carvalho Chehab
2022-07-19  7:19       ` Tvrtko Ursulin
2022-07-19  7:19         ` Tvrtko Ursulin
2022-07-22 12:00   ` Andi Shyti
2022-07-22 12:00     ` [Intel-gfx] " Andi Shyti
2022-07-22 12:00     ` Andi Shyti
2022-07-14 12:06 ` [PATCH v2 06/21] drm/i915/gt: Batch TLB invalidations Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-18 13:52   ` Tvrtko Ursulin
2022-07-18 13:52     ` [Intel-gfx] " Tvrtko Ursulin
2022-07-18 13:52     ` Tvrtko Ursulin
2022-07-20  7:13     ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-20  7:13       ` Mauro Carvalho Chehab
2022-07-20 10:49       ` Tvrtko Ursulin
2022-07-20 10:49         ` Tvrtko Ursulin
2022-07-20 10:54   ` Tvrtko Ursulin
2022-07-20 10:54     ` [Intel-gfx] " Tvrtko Ursulin
2022-07-20 10:54     ` Tvrtko Ursulin
2022-07-27 11:48     ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-27 11:48       ` Mauro Carvalho Chehab
2022-07-27 12:56       ` Tvrtko Ursulin
2022-07-27 12:56         ` Tvrtko Ursulin
2022-07-28  6:32         ` Mauro Carvalho Chehab
2022-07-28  6:32           ` Mauro Carvalho Chehab
2022-07-28  7:26           ` Mauro Carvalho Chehab
2022-07-28  7:26             ` Mauro Carvalho Chehab
2022-07-28 10:11           ` Tvrtko Ursulin
2022-07-28 10:11             ` Tvrtko Ursulin
2022-07-14 12:06 ` [PATCH v2 07/21] drm/i915/gt: describe the new tlb parameter at i915_vma_resource Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-14 12:06 ` [PATCH v2 08/21] drm/i915/gt: Move TLB invalidation to its own file Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-22 12:07   ` Andi Shyti
2022-07-22 12:07     ` [Intel-gfx] " Andi Shyti
2022-07-22 12:07     ` Andi Shyti
2022-07-14 12:06 ` [PATCH v2 09/21] drm/i915/guc: Define CTB based TLB invalidation routines Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-14 14:06   ` Michal Wajdeczko
2022-07-14 14:06     ` [Intel-gfx] " Michal Wajdeczko
2022-07-14 14:06     ` Michal Wajdeczko
2022-08-02  7:48     ` [Intel-gfx] " Mauro Carvalho Chehab
2022-08-02  7:48       ` Mauro Carvalho Chehab
2022-07-14 12:06 ` [PATCH v2 10/21] drm/i915/guc: use kernel-doc for enum intel_guc_tlb_inval_mode Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06 ` [PATCH v2 11/21] drm/i915/guc: document the TLB invalidation struct members Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-14 12:06 ` [PATCH v2 12/21] drm/i915/guc: Introduce TLB_INVALIDATION_ALL action Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-14 12:06 ` [PATCH v2 13/21] drm/i915: Invalidate the TLBs on each GT Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-14 12:06 ` [PATCH v2 14/21] drm/i915: document tlb field at struct drm_i915_gem_object Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-14 12:06 ` [PATCH v2 15/21] drm/i915: Add platform macro for selective tlb flush Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-14 12:06 ` [PATCH v2 16/21] drm/i915: Define GuC Based TLB invalidation routines Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-14 15:20   ` Michal Wajdeczko
2022-07-14 15:20     ` [Intel-gfx] " Michal Wajdeczko
2022-07-14 15:20     ` Michal Wajdeczko
2022-07-14 12:06 ` [PATCH v2 17/21] drm/i915: Add generic interface for tlb invalidation for XeHP Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06 ` [PATCH v2 18/21] drm/i915: Use selective tlb invalidations where supported Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-14 12:06 ` [PATCH v2 19/21] drm/i915/gt: document TLB cache invalidation functions Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06 ` [PATCH v2 20/21] drm/i915/guc: describe enum intel_guc_tlb_invalidation_type Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-14 12:06 ` [PATCH v2 21/21] drm/i915/guc: document TLB cache invalidation functions Mauro Carvalho Chehab
2022-07-14 12:06   ` [Intel-gfx] " Mauro Carvalho Chehab
2022-07-14 12:06   ` Mauro Carvalho Chehab
2022-07-14 12:27 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for Fix performance regressions with TLB and add GuC support (rev3) Patchwork
2022-07-28  8:01 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for Fix performance regressions with TLB and add GuC support (rev4) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.