From: stuartsummers <stuart.summers@intel.com>
Cc: matthew.brost@intel.com, farah.kassabri@intel.com,
intel-xe@lists.freedesktop.org,
stuartsummers <stuart.summers@intel.com>
Subject: [PATCH 1/8] drm/xe: Move explicit CT lock in TLB invalidation sequence
Date: Wed, 6 Aug 2025 22:23:57 +0000 [thread overview]
Message-ID: <20250806222404.30333-2-stuart.summers@intel.com> (raw)
In-Reply-To: <20250806222404.30333-1-stuart.summers@intel.com>
We already have a lock tracking the fences/sequence numbers
here (pending_lock). And the GuC CT code already has an
implicit version of this lock in the ct_send routine.
Prepare the way for future optimizations in TLB invalidation
flow by moving the mutex lock down into the GuC CT send
routine rather than in the upper TLB invalidation layer.
Signed-off-by: stuartsummers <stuart.summers@intel.com>
---
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
index 02f0bb92d6e0..230f30161395 100644
--- a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
+++ b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
@@ -158,7 +158,6 @@ void xe_gt_tlb_invalidation_reset(struct xe_gt *gt)
* appear.
*/
- mutex_lock(>->uc.guc.ct.lock);
spin_lock_irq(>->tlb_invalidation.pending_lock);
cancel_delayed_work(>->tlb_invalidation.fence_tdr);
/*
@@ -178,7 +177,6 @@ void xe_gt_tlb_invalidation_reset(struct xe_gt *gt)
>->tlb_invalidation.pending_fences, link)
invalidation_fence_signal(gt_to_xe(gt), fence);
spin_unlock_irq(>->tlb_invalidation.pending_lock);
- mutex_unlock(>->uc.guc.ct.lock);
}
static bool tlb_invalidation_seqno_past(struct xe_gt *gt, int seqno)
@@ -211,13 +209,12 @@ static int send_tlb_invalidation(struct xe_guc *guc,
* need to be updated.
*/
- mutex_lock(&guc->ct.lock);
seqno = gt->tlb_invalidation.seqno;
fence->seqno = seqno;
trace_xe_gt_tlb_invalidation_fence_send(xe, fence);
action[1] = seqno;
- ret = xe_guc_ct_send_locked(&guc->ct, action, len,
- G2H_LEN_DW_TLB_INVALIDATE, 1);
+ ret = xe_guc_ct_send(&guc->ct, action, len,
+ G2H_LEN_DW_TLB_INVALIDATE, 1);
if (!ret) {
spin_lock_irq(>->tlb_invalidation.pending_lock);
/*
@@ -248,7 +245,6 @@ static int send_tlb_invalidation(struct xe_guc *guc,
if (!gt->tlb_invalidation.seqno)
gt->tlb_invalidation.seqno = 1;
}
- mutex_unlock(&guc->ct.lock);
xe_gt_stats_incr(gt, XE_GT_STATS_ID_TLB_INVAL, 1);
return ret;
--
2.34.1
next prev parent reply other threads:[~2025-08-06 22:24 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-06 22:23 [PATCH 0/8] Add TLB invalidation abstraction stuartsummers
2025-08-06 22:23 ` stuartsummers [this message]
2025-08-07 17:10 ` [PATCH 1/8] drm/xe: Move explicit CT lock in TLB invalidation sequence Summers, Stuart
2025-08-07 17:40 ` Matthew Brost
2025-08-07 18:53 ` Summers, Stuart
2025-08-06 22:23 ` [PATCH 2/8] drm/xe: s/tlb_invalidation/tlb_inval stuartsummers
2025-08-06 22:23 ` [PATCH 3/8] drm/xe: Add xe_tlb_inval structure stuartsummers
2025-08-06 22:24 ` [PATCH 4/8] drm/xe: Add xe_gt_tlb_invalidation_done_handler stuartsummers
2025-08-06 22:24 ` [PATCH 5/8] drm/xe: Decouple TLB invalidations from GT stuartsummers
2025-08-06 22:24 ` [PATCH 6/8] drm/xe: Prep TLB invalidation fence before sending stuartsummers
2025-08-06 22:24 ` [PATCH 7/8] drm/xe: Add helpers to send TLB invalidations stuartsummers
2025-08-06 22:24 ` [PATCH 8/8] drm/xe: Split TLB invalidation code in frontend and backend stuartsummers
2025-08-06 22:32 ` ✗ CI.checkpatch: warning for Add TLB invalidation abstraction (rev3) Patchwork
2025-08-06 22:33 ` ✓ CI.KUnit: success " Patchwork
2025-08-06 23:35 ` ✓ Xe.CI.BAT: " Patchwork
2025-08-07 0:57 ` ✗ Xe.CI.Full: failure " Patchwork
2025-08-07 14:58 ` Summers, Stuart
-- strict thread matches above, loose matches on Subject: below --
2025-08-07 20:39 [PATCH 0/8] Add TLB invalidation abstraction stuartsummers
2025-08-07 20:39 ` [PATCH 1/8] drm/xe: Move explicit CT lock in TLB invalidation sequence stuartsummers
2025-08-07 19:36 [PATCH 0/8] Add TLB invalidation abstraction stuartsummers
2025-08-07 19:36 ` [PATCH 1/8] drm/xe: Move explicit CT lock in TLB invalidation sequence stuartsummers
2025-08-07 19:54 ` Matthew Brost
2025-07-30 20:45 [PATCH 0/8] Add TLB invalidation abstraction stuartsummers
2025-07-30 20:45 ` [PATCH 1/8] drm/xe: Move explicit CT lock in TLB invalidation sequence stuartsummers
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=20250806222404.30333-2-stuart.summers@intel.com \
--to=stuart.summers@intel.com \
--cc=farah.kassabri@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@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.