All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Update page fault queue size calculation
@ 2024-07-09 18:40 Stuart Summers
  2024-07-09 18:40 ` [PATCH 1/2] drm/xe: Fix missing workqueue destroy in xe_gt_pagefault Stuart Summers
                   ` (9 more replies)
  0 siblings, 10 replies; 21+ messages in thread
From: Stuart Summers @ 2024-07-09 18:40 UTC (permalink / raw)
  Cc: matthew.brost, John.C.Harrison, brian.welty, intel-xe,
	Stuart Summers

Right now the page fault queue size is hard coded with an
estimated value based on legacy platforms. Add a more precise
calculation based on the number of compute resources available
which can utilize these page fault queues.

v2: Add a drm reset callback for the teardown changes and other
    suggestions from Matt.

Original series: https://patchwork.freedesktop.org/series/134694/

Stuart Summers (2):
  drm/xe: Fix missing workqueue destroy in xe_gt_pagefault
  drm/xe: Use topology to determine page fault queue size

 drivers/gpu/drm/xe/xe_gt_pagefault.c | 68 ++++++++++++++++++++++------
 drivers/gpu/drm/xe/xe_gt_types.h     |  9 +++-
 2 files changed, 62 insertions(+), 15 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 21+ messages in thread
* [PATCH 0/2] Update page fault queue size calculation
@ 2024-07-11 17:36 Stuart Summers
  2024-07-11 17:36 ` [PATCH 1/2] drm/xe: Fix missing workqueue destroy in xe_gt_pagefault Stuart Summers
  0 siblings, 1 reply; 21+ messages in thread
From: Stuart Summers @ 2024-07-11 17:36 UTC (permalink / raw)
  Cc: matthew.brost, John.C.Harrison, brian.welty, intel-xe,
	rodrigo.vivi, Stuart Summers

Right now the page fault queue size is hard coded with an
estimated value based on legacy platforms. Add a more precise
calculation based on the number of compute resources available
which can utilize these page fault queues.

v2: Add a drm reset callback for the teardown changes and other
    suggestions from Matt.
v3: Add a pf_wq destroy when the access counter wq allocation
    fails (Rodrigo) and pf queue size calculation adjustment (Matt)

Original series: https://patchwork.freedesktop.org/series/134694/

Stuart Summers (2):
  drm/xe: Fix missing workqueue destroy in xe_gt_pagefault
  drm/xe: Use topology to determine page fault queue size

 drivers/gpu/drm/xe/xe_gt_pagefault.c | 72 ++++++++++++++++++++++------
 drivers/gpu/drm/xe/xe_gt_types.h     |  9 +++-
 2 files changed, 65 insertions(+), 16 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 21+ messages in thread
* [PATCH 1/2] drm/xe: Fix missing workqueue destroy in xe_gt_pagefault
@ 2024-06-10 20:32 Stuart Summers
  2024-06-10 22:36 ` Matthew Brost
  0 siblings, 1 reply; 21+ messages in thread
From: Stuart Summers @ 2024-06-10 20:32 UTC (permalink / raw)
  Cc: brian.welty, intel-xe, Stuart Summers

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>
---
 drivers/gpu/drm/xe/xe_gt.c           |  2 ++
 drivers/gpu/drm/xe/xe_gt_pagefault.c | 11 +++++++++++
 drivers/gpu/drm/xe/xe_gt_pagefault.h |  1 +
 3 files changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index 57d84751e160..68dc6920112b 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -107,6 +107,8 @@ void xe_gt_remove(struct xe_gt *gt)
 
 	xe_uc_remove(&gt->uc);
 
+	xe_gt_pagefault_fini(gt);
+
 	for (i = 0; i < XE_ENGINE_CLASS_MAX; ++i)
 		xe_hw_fence_irq_finish(&gt->fence_irq[i]);
 }
diff --git a/drivers/gpu/drm/xe/xe_gt_pagefault.c b/drivers/gpu/drm/xe/xe_gt_pagefault.c
index eaf68f0135c1..3858c8e0b707 100644
--- a/drivers/gpu/drm/xe/xe_gt_pagefault.c
+++ b/drivers/gpu/drm/xe/xe_gt_pagefault.c
@@ -415,6 +415,17 @@ int xe_gt_pagefault_init(struct xe_gt *gt)
 	return 0;
 }
 
+void xe_gt_pagefault_fini(struct xe_gt *gt)
+{
+	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);
+}
+
 void xe_gt_pagefault_reset(struct xe_gt *gt)
 {
 	struct xe_device *xe = gt_to_xe(gt);
diff --git a/drivers/gpu/drm/xe/xe_gt_pagefault.h b/drivers/gpu/drm/xe/xe_gt_pagefault.h
index 839c065a5e4c..d37b790ce8bb 100644
--- a/drivers/gpu/drm/xe/xe_gt_pagefault.h
+++ b/drivers/gpu/drm/xe/xe_gt_pagefault.h
@@ -12,6 +12,7 @@ struct xe_gt;
 struct xe_guc;
 
 int xe_gt_pagefault_init(struct xe_gt *gt);
+void xe_gt_pagefault_fini(struct xe_gt *gt);
 void xe_gt_pagefault_reset(struct xe_gt *gt);
 int xe_guc_pagefault_handler(struct xe_guc *guc, u32 *msg, u32 len);
 int xe_guc_access_counter_notify_handler(struct xe_guc *guc, u32 *msg, u32 len);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2024-07-11 17:36 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-09 18:40 [PATCH 0/2] Update page fault queue size calculation Stuart Summers
2024-07-09 18:40 ` [PATCH 1/2] drm/xe: Fix missing workqueue destroy in xe_gt_pagefault Stuart Summers
2024-07-09 18:59   ` Rodrigo Vivi
2024-07-09 20:48     ` Matthew Brost
2024-07-09 22:54       ` Summers, Stuart
2024-07-09 18:41 ` [PATCH 2/2] drm/xe: Use topology to determine page fault queue size Stuart Summers
2024-07-09 20:52   ` Matthew Brost
2024-07-09 22:53     ` Summers, Stuart
2024-07-11 17:26       ` Summers, Stuart
2024-07-09 18:48 ` ✓ CI.Patch_applied: success for Update page fault queue size calculation Patchwork
2024-07-09 18:48 ` ✓ CI.checkpatch: " Patchwork
2024-07-09 18:49 ` ✓ CI.KUnit: " Patchwork
2024-07-09 19:01 ` ✓ CI.Build: " Patchwork
2024-07-09 19:03 ` ✗ CI.Hooks: failure " Patchwork
2024-07-09 19:05 ` ✓ CI.checksparse: success " Patchwork
2024-07-09 19:39 ` ✓ CI.BAT: " Patchwork
2024-07-09 21:40 ` ✓ CI.FULL: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2024-07-11 17:36 [PATCH 0/2] " Stuart Summers
2024-07-11 17:36 ` [PATCH 1/2] drm/xe: Fix missing workqueue destroy in xe_gt_pagefault Stuart Summers
2024-06-10 20:32 Stuart Summers
2024-06-10 22:36 ` Matthew Brost
2024-06-25 17:17   ` Summers, Stuart

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.