From: Stuart Summers <stuart.summers@intel.com>
Cc: matthew.brost@intel.com, John.C.Harrison@Intel.com,
brian.welty@intel.com, rodrigo.vivi@intel.com,
intel-xe@lists.freedesktop.org,
Stuart Summers <stuart.summers@intel.com>
Subject: [CI 1/3] drm/xe: Fix missing workqueue destroy in xe_gt_pagefault
Date: Mon, 29 Jul 2024 16:19:45 +0000 [thread overview]
Message-ID: <fa90c7b5d3813cd243a92794bce5c8d3ec48fdbf.1722269793.git.stuart.summers@intel.com> (raw)
In-Reply-To: <cover.1722269793.git.stuart.summers@intel.com>
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@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
drivers/gpu/drm/xe/xe_gt_pagefault.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_gt_pagefault.c b/drivers/gpu/drm/xe/xe_gt_pagefault.c
index 9292d5468868..b2a7fa55bd18 100644
--- a/drivers/gpu/drm/xe/xe_gt_pagefault.c
+++ b/drivers/gpu/drm/xe/xe_gt_pagefault.c
@@ -382,6 +382,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);
@@ -409,10 +421,12 @@ int xe_gt_pagefault_init(struct xe_gt *gt)
gt->usm.acc_wq = alloc_workqueue("xe_gt_access_counter_work_queue",
WQ_UNBOUND | WQ_HIGHPRI,
NUM_ACC_QUEUE);
- if (!gt->usm.acc_wq)
+ if (!gt->usm.acc_wq) {
+ destroy_workqueue(gt->usm.pf_wq);
return -ENOMEM;
+ }
- 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
next prev parent reply other threads:[~2024-07-29 16:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-29 16:19 [CI 0/3] Update page fault queue size calculation Stuart Summers
2024-07-29 16:19 ` Stuart Summers [this message]
2024-07-29 16:19 ` [CI 2/3] drm/xe: Use topology to determine page fault queue size Stuart Summers
2024-08-11 9:40 ` Dafna Hirschfeld
2024-07-29 16:19 ` [CI 3/3] drm/xe/guc: Bump the G2H queue size to account for page faults Stuart Summers
2024-07-29 16:26 ` ✓ CI.Patch_applied: success for Update page fault queue size calculation (rev5) Patchwork
2024-07-29 16:26 ` ✓ CI.checkpatch: " Patchwork
2024-07-29 16:27 ` ✓ CI.KUnit: " Patchwork
2024-07-29 16:39 ` ✓ CI.Build: " Patchwork
2024-07-29 16:41 ` ✗ CI.Hooks: failure " Patchwork
2024-07-29 16:43 ` ✓ CI.checksparse: success " Patchwork
2024-07-29 17:03 ` ✓ CI.BAT: " Patchwork
2024-07-29 21:26 ` ✗ CI.FULL: failure " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2024-08-17 2:47 [CI 0/3] Update page fault queue size calculation Stuart Summers
2024-08-17 2:47 ` [CI 1/3] drm/xe: Fix missing workqueue destroy in xe_gt_pagefault Stuart Summers
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=fa90c7b5d3813cd243a92794bce5c8d3ec48fdbf.1722269793.git.stuart.summers@intel.com \
--to=stuart.summers@intel.com \
--cc=John.C.Harrison@Intel.com \
--cc=brian.welty@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=rodrigo.vivi@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