[PATCH 1/2] drm/xe: Fix missing workqueue destroy in xe_gt_pagefault
Matthew Brost
matthew.brost at intel.com
Tue Jul 9 20:48:43 UTC 2024
On Tue, Jul 09, 2024 at 02:59:41PM -0400, Rodrigo Vivi wrote:
> On Tue, Jul 09, 2024 at 06:40:59PM +0000, Stuart Summers wrote:
> > On driver reload we never free up the memory for the pagefault and
> > access counter workqueues. Add those destroy calls here.
> >
> > Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
> > Signed-off-by: Stuart Summers <stuart.summers at intel.com>
> > ---
> > drivers/gpu/drm/xe/xe_gt_pagefault.c | 14 +++++++++++++-
> > 1 file changed, 13 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/xe/xe_gt_pagefault.c b/drivers/gpu/drm/xe/xe_gt_pagefault.c
> > index e18659201208..ded8e3c33a82 100644
> > --- a/drivers/gpu/drm/xe/xe_gt_pagefault.c
> > +++ b/drivers/gpu/drm/xe/xe_gt_pagefault.c
> > @@ -398,6 +398,18 @@ static void pf_queue_work_func(struct work_struct *w)
> >
> > static void acc_queue_work_func(struct work_struct *w);
> >
> > +static void pagefault_fini(void *arg)
> > +{
> > + struct xe_gt *gt = arg;
> > + struct xe_device *xe = gt_to_xe(gt);
> > +
> > + if (!xe->info.has_usm)
> > + return;
> > +
> > + destroy_workqueue(gt->usm.acc_wq);
> > + destroy_workqueue(gt->usm.pf_wq);
> > +}
> > +
> > int xe_gt_pagefault_init(struct xe_gt *gt)
> > {
> > struct xe_device *xe = gt_to_xe(gt);
> > @@ -428,7 +440,7 @@ int xe_gt_pagefault_init(struct xe_gt *gt)
> > if (!gt->usm.acc_wq)
> > return -ENOMEM;
>
> I believe we should destroy the pf_wq in this return, no?!
>
Yes, I was going to say the same thing in my review - we need to destroy
pf_wq here.
Matt
> with that fixed or clarified,
>
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
>
> >
> > - return 0;
> > + return devm_add_action_or_reset(xe->drm.dev, pagefault_fini, gt);
> > }
> >
> > void xe_gt_pagefault_reset(struct xe_gt *gt)
> > --
> > 2.34.1
> >
More information about the Intel-xe
mailing list