[PATCH 0/6] Use DRM scheduler for delayed GT TLB invalidations
Matthew Brost
matthew.brost at intel.com
Tue Jun 17 15:37:24 UTC 2025
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.
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.
Matt
[1] https://patchwork.freedesktop.org/patch/658370/?series=150188&rev=1
Matthew Brost (6):
drm/xe: Explicitly mark migration queues with flag
drm/xe: Add generic dependecy jobs / scheduler
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
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 | 24 ++
drivers/gpu/drm/xe/xe_exec_queue_types.h | 15 ++
drivers/gpu/drm/xe/xe_gt_tlb_inval_job.c | 274 +++++++++++++++++++++++
drivers/gpu/drm/xe/xe_gt_tlb_inval_job.h | 34 +++
drivers/gpu/drm/xe/xe_migrate.c | 44 +++-
drivers/gpu/drm/xe/xe_migrate.h | 13 ++
drivers/gpu/drm/xe/xe_pt.c | 193 +++++++---------
11 files changed, 678 insertions(+), 116 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
More information about the Intel-xe
mailing list