[PATCH v2 4/9] drm/xe: Create ordered workqueue for GT TLB invalidation jobs
Matthew Brost
matthew.brost at intel.com
Thu Jul 17 19:59:39 UTC 2025
On Thu, Jul 17, 2025 at 01:55:21PM -0600, Summers, Stuart wrote:
> On Wed, 2025-07-02 at 16:42 -0700, Matthew Brost wrote:
> > No sense to schedule GT TLB invalidation jobs in parallel which
> > target
> > the same given these all contend on the same lock, create ordered
>
> This was supposed to be "in parallel which target the same exec queue"?
>
'same GT'.
Will fix.
Matt
> > workqueue for GT TLB invalidation jobs.
> >
> > Signed-off-by: Matthew Brost <matthew.brost at intel.com>
>
> I still think we should be including these patches with patches that
> actually use what is implemented here generally, but not a huge deal
> here. This is pretty straight forward and already used in the
> subsequent patches in the series.
>
> Verified also the drmm_alloc_ordered_workqueue is auto destroyed on the
> drm dev put.
>
> Other than the minor commit message confusion above:
> Reviewed-by: Stuart Summers <stuart.summers at intel.com>
>
> > ---
> > drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 8 ++++++++
> > drivers/gpu/drm/xe/xe_gt_types.h | 2 ++
> > 2 files changed, 10 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
> > b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
> > index 6088df8e159c..f6f32600e8a5 100644
> > --- a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
> > +++ b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
> > @@ -3,6 +3,8 @@
> > * Copyright © 2023 Intel Corporation
> > */
> >
> > +#include <drm/drm_managed.h>
> > +
> > #include "xe_gt_tlb_invalidation.h"
> >
> > #include "abi/guc_actions_abi.h"
> > @@ -123,6 +125,12 @@ int xe_gt_tlb_invalidation_init_early(struct
> > xe_gt *gt)
> > INIT_DELAYED_WORK(>->tlb_invalidation.fence_tdr,
> > xe_gt_tlb_fence_timeout);
> >
> > + gt->tlb_invalidation.job_wq =
> > + drmm_alloc_ordered_workqueue(>_to_xe(gt)->drm, "gt-
> > tbl-inval-job-wq",
> > + WQ_MEM_RECLAIM);
> > + if (IS_ERR(gt->tlb_invalidation.job_wq))
> > + return PTR_ERR(gt->tlb_invalidation.job_wq);
> > +
> > return 0;
> > }
> >
> > diff --git a/drivers/gpu/drm/xe/xe_gt_types.h
> > b/drivers/gpu/drm/xe/xe_gt_types.h
> > index 96344c604726..dfd4a16da5f0 100644
> > --- a/drivers/gpu/drm/xe/xe_gt_types.h
> > +++ b/drivers/gpu/drm/xe/xe_gt_types.h
> > @@ -210,6 +210,8 @@ struct xe_gt {
> > * xe_gt_tlb_fence_timeout after the timeut interval
> > is over.
> > */
> > struct delayed_work fence_tdr;
> > + /** @wtlb_invalidation.wq: schedules GT TLB
> > invalidation jobs */
> > + struct workqueue_struct *job_wq;
> > /** @tlb_invalidation.lock: protects TLB invalidation
> > fences */
> > spinlock_t lock;
> > } tlb_invalidation;
>
More information about the Intel-xe
mailing list