Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: farah.kassabri@intel.com, michal.wajdeczko@intel.com
Subject: [PATCH 10/11] drm/xe: Add GT TLB coalesce tracepoints
Date: Fri,  5 Jul 2024 17:02:51 -0700	[thread overview]
Message-ID: <20240706000252.702044-11-matthew.brost@intel.com> (raw)
In-Reply-To: <20240706000252.702044-1-matthew.brost@intel.com>

Add visibility to GT TLB coalescing.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 10 +++++++++-
 drivers/gpu/drm/xe/xe_trace.h               | 10 ++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
index b85089d27a36..c7634acea938 100644
--- a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
+++ b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
@@ -362,7 +362,8 @@ xe_gt_tlb_invalidation_coalesce_issue(struct xe_gt *gt,
 	list_for_each_entry(fence, &coalesce->fence_list, link) {
 		fence->seqno = seqno;
 		fence->invalidation_time = ktime_get();
-		trace_xe_gt_tlb_invalidation_fence_send(gt_to_xe(gt), fence);
+		trace_xe_gt_tlb_invalidation_fence_send_coalesce(gt_to_xe(gt),
+								 fence);
 	}
 
 	spin_lock_irq(&gt->tlb_invalidation.pending_lock);
@@ -411,6 +412,8 @@ xe_gt_tlb_invalidation_coalesce_prep(struct xe_gt *gt,
 		goto unlock;
 	}
 
+	trace_xe_gt_tlb_invalidation_fence_coalesce(gt_to_xe(gt), fence);
+
 	if (list_empty(&coalesce->link))
 		list_add_tail(&coalesce->link,
 			      &gt->tlb_invalidation.pending_coalesce);
@@ -469,6 +472,9 @@ int xe_gt_tlb_invalidation_ggtt(struct xe_gt *gt,
 {
 	struct xe_device *xe = gt_to_xe(gt);
 
+	xe_gt_assert(gt, coalesce);
+	xe_gt_assert(gt, coalesce->type == XE_GT_TLB_INVALIDATION_COALESCE_GGTT);
+
 	if (xe_guc_ct_enabled(&gt->uc.guc.ct) &&
 	    gt->uc.guc.submission_state.enabled) {
 		struct xe_gt_tlb_invalidation_fence fence;
@@ -527,6 +533,8 @@ int xe_gt_tlb_invalidation_range(struct xe_gt *gt,
 	int ret = 0;
 
 	xe_gt_assert(gt, fence);
+	xe_gt_assert(gt, coalesce);
+	xe_gt_assert(gt, coalesce->type == XE_GT_TLB_INVALIDATION_COALESCE_PPGTT);
 
 	mutex_lock(&gt->tlb_invalidation.seqno_lock);
 
diff --git a/drivers/gpu/drm/xe/xe_trace.h b/drivers/gpu/drm/xe/xe_trace.h
index 09ca1ad057b0..e2c5af5a1d23 100644
--- a/drivers/gpu/drm/xe/xe_trace.h
+++ b/drivers/gpu/drm/xe/xe_trace.h
@@ -60,11 +60,21 @@ DEFINE_EVENT(xe_gt_tlb_invalidation_fence, xe_gt_tlb_invalidation_fence_cb,
 	     TP_ARGS(xe, fence)
 );
 
+DEFINE_EVENT(xe_gt_tlb_invalidation_fence, xe_gt_tlb_invalidation_fence_coalesce,
+	     TP_PROTO(struct xe_device *xe, struct xe_gt_tlb_invalidation_fence *fence),
+	     TP_ARGS(xe, fence)
+);
+
 DEFINE_EVENT(xe_gt_tlb_invalidation_fence, xe_gt_tlb_invalidation_fence_send,
 	     TP_PROTO(struct xe_device *xe, struct xe_gt_tlb_invalidation_fence *fence),
 	     TP_ARGS(xe, fence)
 );
 
+DEFINE_EVENT(xe_gt_tlb_invalidation_fence, xe_gt_tlb_invalidation_fence_send_coalesce,
+	     TP_PROTO(struct xe_device *xe, struct xe_gt_tlb_invalidation_fence *fence),
+	     TP_ARGS(xe, fence)
+);
+
 DEFINE_EVENT(xe_gt_tlb_invalidation_fence, xe_gt_tlb_invalidation_fence_recv,
 	     TP_PROTO(struct xe_device *xe, struct xe_gt_tlb_invalidation_fence *fence),
 	     TP_ARGS(xe, fence)
-- 
2.34.1


  parent reply	other threads:[~2024-07-06  0:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-06  0:02 [PATCH 00/11] Proper GT TLB invalidation layering and new coalescing feature Matthew Brost
2024-07-06  0:02 ` [PATCH 01/11] drm/xe: Add xe_gt_tlb_invalidation_fence_init helper Matthew Brost
2024-07-06  0:02 ` [PATCH 02/11] drm/xe: Drop xe_gt_tlb_invalidation_wait Matthew Brost
2024-07-06  0:02 ` [PATCH 03/11] drm/xe: s/tlb_invalidation.lock/tlb_invalidation.fence_lock Matthew Brost
2024-07-06  0:02 ` [PATCH 04/11] drm/xe: Add tlb_invalidation.seqno_lock Matthew Brost
2024-07-06  0:02 ` [PATCH 05/11] drm/xe: Add xe_gt_tlb_invalidation_done_handler Matthew Brost
2024-07-06  0:02 ` [PATCH 06/11] drm/xe: Add send tlb invalidation helpers Matthew Brost
2024-07-06  0:02 ` [PATCH 07/11] drm/xe: Add xe_guc_tlb_invalidation layer Matthew Brost
2024-07-06  0:02 ` [PATCH 08/11] drm/xe: Add multi-client support for GT TLB invalidations Matthew Brost
2024-07-06  0:02 ` [PATCH 09/11] drm/xe: Add GT TLB invalidation coalescing Matthew Brost
2024-07-06  0:02 ` Matthew Brost [this message]
2024-07-06  0:02 ` [PATCH 11/11] drm/xe: Add GT TLB invalidation watermark debugfs Matthew Brost
2024-07-06  0:07 ` ✓ CI.Patch_applied: success for Proper GT TLB invalidation layering and new coalescing feature Patchwork
2024-07-06  0:07 ` ✗ CI.checkpatch: warning " Patchwork
2024-07-06  0:08 ` ✓ CI.KUnit: success " Patchwork
2024-07-06  0:20 ` ✓ CI.Build: " Patchwork
2024-07-06  0:22 ` ✗ CI.Hooks: failure " Patchwork
2024-07-06  0:24 ` ✓ CI.checksparse: success " Patchwork
2024-07-06  0:53 ` ✗ CI.BAT: failure " Patchwork
2024-07-06  1:41 ` ✗ CI.FULL: " 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=20240706000252.702044-11-matthew.brost@intel.com \
    --to=matthew.brost@intel.com \
    --cc=farah.kassabri@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=michal.wajdeczko@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox