[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240730221742.2248527-3-matthew.brost@intel.com>
Date: Tue, 30 Jul 2024 15:17:41 -0700
From: Matthew Brost <matthew.brost@...el.com>
To: intel-xe@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Cc: tj@...nel.org,
jiangshanlai@...il.com,
christian.koenig@....com,
ltuikov89@...il.com,
daniel@...ll.ch
Subject: [RFC PATCH 2/3] drm/sched: Use drm sched lockdep map for submit_wq
Avoid leaking a lockdep map on each drm sched creation and destruction
by using a single lockdep map for all drm sched allocated submit_wq.
Cc: Luben Tuikov <ltuikov89@...il.com>
Cc: Christian König <christian.koenig@....com>
Signed-off-by: Matthew Brost <matthew.brost@...el.com>
---
drivers/gpu/drm/scheduler/sched_main.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
index ab53ab486fe6..9849fd64aff9 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -87,6 +87,12 @@
#define CREATE_TRACE_POINTS
#include "gpu_scheduler_trace.h"
+#ifdef CONFIG_LOCKDEP
+static struct lockdep_map drm_sched_lockdep_map = {
+ .name = "drm_sched_lockdep_map"
+};
+#endif
+
#define to_drm_sched_job(sched_job) \
container_of((sched_job), struct drm_sched_job, queue_node)
@@ -1272,9 +1278,13 @@ int drm_sched_init(struct drm_gpu_scheduler *sched,
sched->submit_wq = submit_wq;
sched->own_submit_wq = false;
} else {
- sched->submit_wq = alloc_ordered_workqueue(name, 0);
+ sched->submit_wq = alloc_ordered_workqueue(name, WQ_USER_OWNED_LOCKDEP);
if (!sched->submit_wq)
return -ENOMEM;
+#ifdef CONFIG_LOCKDEP
+ wq_init_user_lockdep_map(sched->submit_wq,
+ &drm_sched_lockdep_map);
+#endif
sched->own_submit_wq = true;
}
--
2.34.1
Powered by blists - more mailing lists