intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/9] Use DRM scheduler for delayed GT TLB invalidations
@ 2025-07-02 23:42 Matthew Brost
  2025-07-02 23:42 ` [PATCH v2 1/9] drm/xe: Explicitly mark migration queues with flag Matthew Brost
                   ` (13 more replies)
  0 siblings, 14 replies; 45+ messages in thread
From: Matthew Brost @ 2025-07-02 23:42 UTC (permalink / raw)
  To: intel-xe; +Cc: matthew.auld, maarten.lankhorst

Use the DRM scheduler for delayed GT TLB invalidations, which properly
fixes the issue raised in [1]. GT TLB fences have their own dma-fence
context, so even if the invalidations are ordered, the dma-resv/DRM
scheduler cannot squash the fences. This results in O(M*N*N) complexity
in the garbage collector, where M is the number of ranges in the garbage
collector and N is the number of pending GT TLB invalidations. After
this change, the resulting complexity in O(M*C) where C is the number of
TLB invalidation contexts (i.e., number of exec queue, GTs tuples) with
an invalidation in flight.

Admittedly, it's quite a lot of code, but the series includes extensive
kernel documentation and clear code comments. It introduces a generic
dependency scheduler that can be reused in the future and is logically
much cleaner than the previous open-coded solution for delaying GT TLB
invalidations until a bind job completes.

v2:
 - Various cleanup covered in detail in change logs
 - Use a per-GT ordered workqueue as DRM scheduler workqueue
 - Remove unused ftrace points

Matt

[1] https://patchwork.freedesktop.org/patch/658370/?series=150188&rev=1

Matthew Brost (9):
  drm/xe: Explicitly mark migration queues with flag
  drm/xe: Add generic dependecy jobs / scheduler
  drm: Simplify drmm_alloc_ordered_workqueue return
  drm/xe: Create ordered workqueue for GT TLB invalidation jobs
  drm/xe: Add dependency scheduler for GT TLB invalidations to bind
    queues
  drm/xe: Add xe_migrate_job_lock/unlock helpers
  drm/xe: Add GT TLB invalidation jobs
  drm/xe: Use GT TLB invalidation jobs in PT layer
  drm/xe: Remove unused GT TLB invalidation trace points

 drivers/gpu/drm/vkms/vkms_crtc.c            |   2 -
 drivers/gpu/drm/xe/Makefile                 |   2 +
 drivers/gpu/drm/xe/xe_dep_job_types.h       |  29 +++
 drivers/gpu/drm/xe/xe_dep_scheduler.c       | 145 +++++++++++
 drivers/gpu/drm/xe/xe_dep_scheduler.h       |  21 ++
 drivers/gpu/drm/xe/xe_exec_queue.c          |  48 ++++
 drivers/gpu/drm/xe/xe_exec_queue_types.h    |  15 ++
 drivers/gpu/drm/xe/xe_gt_tlb_inval_job.c    | 271 ++++++++++++++++++++
 drivers/gpu/drm/xe/xe_gt_tlb_inval_job.h    |  34 +++
 drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c |   8 +
 drivers/gpu/drm/xe/xe_gt_types.h            |   2 +
 drivers/gpu/drm/xe/xe_migrate.c             |  42 ++-
 drivers/gpu/drm/xe/xe_migrate.h             |  13 +
 drivers/gpu/drm/xe/xe_pt.c                  | 178 +++++--------
 drivers/gpu/drm/xe/xe_trace.h               |  16 --
 include/drm/drm_managed.h                   |  15 +-
 16 files changed, 712 insertions(+), 129 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/xe_dep_job_types.h
 create mode 100644 drivers/gpu/drm/xe/xe_dep_scheduler.c
 create mode 100644 drivers/gpu/drm/xe/xe_dep_scheduler.h
 create mode 100644 drivers/gpu/drm/xe/xe_gt_tlb_inval_job.c
 create mode 100644 drivers/gpu/drm/xe/xe_gt_tlb_inval_job.h

-- 
2.34.1


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

end of thread, other threads:[~2025-07-17 22:36 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02 23:42 [PATCH v2 0/9] Use DRM scheduler for delayed GT TLB invalidations Matthew Brost
2025-07-02 23:42 ` [PATCH v2 1/9] drm/xe: Explicitly mark migration queues with flag Matthew Brost
2025-07-10  8:43   ` Francois Dugast
2025-07-11 21:20   ` Summers, Stuart
2025-07-02 23:42 ` [PATCH v2 2/9] drm/xe: Add generic dependecy jobs / scheduler Matthew Brost
2025-07-10 11:51   ` Francois Dugast
2025-07-10 17:38     ` Matthew Brost
2025-07-15 21:04   ` Summers, Stuart
2025-07-15 21:14     ` Matthew Brost
2025-07-15 21:13       ` Summers, Stuart
2025-07-15 22:43         ` Summers, Stuart
2025-07-15 22:48           ` Matthew Brost
2025-07-02 23:42 ` [PATCH v2 3/9] drm: Simplify drmm_alloc_ordered_workqueue return Matthew Brost
2025-07-16  1:10   ` Matthew Brost
2025-07-02 23:42 ` [PATCH v2 4/9] drm/xe: Create ordered workqueue for GT TLB invalidation jobs Matthew Brost
2025-07-17 19:55   ` Summers, Stuart
2025-07-17 19:59     ` Matthew Brost
2025-07-02 23:42 ` [PATCH v2 5/9] drm/xe: Add dependency scheduler for GT TLB invalidations to bind queues Matthew Brost
2025-07-15 21:34   ` Summers, Stuart
2025-07-15 21:44     ` Matthew Brost
2025-07-15 21:45       ` Summers, Stuart
2025-07-15 21:52         ` Matthew Brost
2025-07-15 21:53           ` Summers, Stuart
2025-07-15 22:01             ` Matthew Brost
2025-07-15 22:49               ` Summers, Stuart
2025-07-02 23:42 ` [PATCH v2 6/9] drm/xe: Add xe_migrate_job_lock/unlock helpers Matthew Brost
2025-07-15 22:48   ` Summers, Stuart
2025-07-16  1:11     ` Matthew Brost
2025-07-02 23:42 ` [PATCH v2 7/9] drm/xe: Add GT TLB invalidation jobs Matthew Brost
2025-07-15 23:09   ` Summers, Stuart
2025-07-16  1:08     ` Matthew Brost
2025-07-17 15:58       ` Summers, Stuart
2025-07-02 23:42 ` [PATCH v2 8/9] drm/xe: Use GT TLB invalidation jobs in PT layer Matthew Brost
2025-07-17 21:00   ` Summers, Stuart
2025-07-17 21:07     ` Matthew Brost
2025-07-17 22:26       ` Summers, Stuart
2025-07-17 22:35         ` Matthew Brost
2025-07-17 22:36           ` Summers, Stuart
2025-07-02 23:42 ` [PATCH v2 9/9] drm/xe: Remove unused GT TLB invalidation trace points Matthew Brost
2025-07-11 21:13   ` Summers, Stuart
2025-07-03  0:45 ` ✗ CI.checkpatch: warning for Use DRM scheduler for delayed GT TLB invalidations (rev2) Patchwork
2025-07-03  0:46 ` ✓ CI.KUnit: success " Patchwork
2025-07-03  1:00 ` ✗ CI.checksparse: warning " Patchwork
2025-07-03  1:32 ` ✓ Xe.CI.BAT: success " Patchwork
2025-07-04 18:11 ` ✗ Xe.CI.Full: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).