All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: <intel-xe@lists.freedesktop.org>
Cc: <thomas.hellstrom@linux.intel.com>,
	<himal.prasad.ghimiray@intel.com>, <matthew.auld@intel.com>
Subject: Re: [PATCH 0/6] Use DRM scheduler for delayed GT TLB invalidations
Date: Tue, 17 Jun 2025 10:30:08 -0700	[thread overview]
Message-ID: <aFGmIO0VLFBcpmmy@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <20250617153730.2136174-1-matthew.brost@intel.com>

On Tue, Jun 17, 2025 at 08:37:24AM -0700, Matthew Brost wrote:
> 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 patch, the complexity is O(M*C) where C is the total number
of GT, queue tuples with GT TLB invalidations pending.

Matt 

> 
> 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
> 

  parent reply	other threads:[~2025-06-17 17:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-17 15:37 [PATCH 0/6] Use DRM scheduler for delayed GT TLB invalidations Matthew Brost
2025-06-17 15:37 ` [PATCH 1/6] drm/xe: Explicitly mark migration queues with flag Matthew Brost
2025-06-17 15:37 ` [PATCH 2/6] drm/xe: Add generic dependecy jobs / scheduler Matthew Brost
2025-06-18 11:20   ` Thomas Hellström
2025-06-18 14:10     ` Matthew Brost
2025-06-24  5:34       ` Matthew Brost
2025-06-17 15:37 ` [PATCH 3/6] drm/xe: Add dependency scheduler for GT TLB invalidations to bind queues Matthew Brost
2025-06-17 15:37 ` [PATCH 4/6] drm/xe: Add xe_migrate_job_lock/unlock helpers Matthew Brost
2025-06-17 15:37 ` [PATCH 5/6] drm/xe: Add GT TLB invalidation jobs Matthew Brost
2025-06-17 15:37 ` [PATCH 6/6] drm/xe: Use GT TLB invalidation jobs in PT layer Matthew Brost
2025-06-18 23:51   ` Matthew Brost
2025-06-17 16:39 ` ✗ CI.checkpatch: warning for Use DRM scheduler for delayed GT TLB invalidations Patchwork
2025-06-17 16:40 ` ✓ CI.KUnit: success " Patchwork
2025-06-17 17:30 ` Matthew Brost [this message]
2025-06-17 17:40 ` ✓ Xe.CI.BAT: " Patchwork
2025-06-18  0:33 ` ✗ Xe.CI.Full: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aFGmIO0VLFBcpmmy@lstrano-desk.jf.intel.com \
    --to=matthew.brost@intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=thomas.hellstrom@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.