From: Matthew Brost <matthew.brost@intel.com>
To: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
<tj@kernel.org>, <jiangshanlai@gmail.com>,
<christian.koenig@amd.com>, <ltuikov89@gmail.com>,
<daniel@ffwll.ch>
Subject: Re: [PATCH v3 4/5] drm/sched: Use drm sched lockdep map for submit_wq
Date: Tue, 13 Aug 2024 19:16:43 +0000 [thread overview]
Message-ID: <ZruxG8YaHqV1CAgS@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <8b9928cc-dce9-4cfd-b1a9-0112266d60df@intel.com>
On Mon, Aug 12, 2024 at 11:05:31AM +0530, Ghimiray, Himal Prasad wrote:
>
>
> On 10-08-2024 03:58, Matthew Brost wrote:
> > 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.
> >
> > v2:
> > - Use alloc_ordered_workqueue_lockdep_map (Tejun)
> >
> > Cc: Luben Tuikov <ltuikov89@gmail.com>
> > Cc: Christian König <christian.koenig@amd.com>
> > Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> > ---
> > drivers/gpu/drm/scheduler/sched_main.c | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
> > index ab53ab486fe6..cf79d348cb32 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"
> > +};
>
>
> will it be better to use STATIC_LOCKDEP_MAP_INIT ? Initializing key here
> instead of while registering the class ?
>
Most existing design patterns in the kernel define static lockdep class
this way so I think this is fine. But honestly don't really have an
opinion here.
Matt
>
> > +#endif
> > +
> > #define to_drm_sched_job(sched_job) \
> > container_of((sched_job), struct drm_sched_job, queue_node)
> > @@ -1272,7 +1278,12 @@ int drm_sched_init(struct drm_gpu_scheduler *sched,
> > sched->submit_wq = submit_wq;
> > sched->own_submit_wq = false;
> > } else {
> > +#ifdef CONFIG_LOCKDEP
> > + sched->submit_wq = alloc_ordered_workqueue_lockdep_map(name, 0,
> > + &drm_sched_lockdep_map);
> > +#else
> > sched->submit_wq = alloc_ordered_workqueue(name, 0);
> > +#endif
> > if (!sched->submit_wq)
> > return -ENOMEM;
next prev parent reply other threads:[~2024-08-13 19:18 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-09 22:28 [PATCH v3 0/5] Use user-defined workqueue lockdep map for drm sched Matthew Brost
2024-08-09 22:28 ` [PATCH v3 1/5] workqueue: Split alloc_workqueue into internal function and lockdep init Matthew Brost
2024-08-13 6:13 ` kernel test robot
2024-08-09 22:28 ` [PATCH v3 2/5] workqueue: Change workqueue lockdep map to pointer Matthew Brost
2024-08-09 22:28 ` [PATCH v3 3/5] workqueue: Add interface for user-defined workqueue lockdep map Matthew Brost
2024-08-12 5:03 ` Ghimiray, Himal Prasad
2024-08-13 18:52 ` Tejun Heo
2024-08-13 18:55 ` Matthew Brost
2024-08-13 19:05 ` Tejun Heo
2024-08-13 19:06 ` Tejun Heo
2024-08-09 22:28 ` [PATCH v3 4/5] drm/sched: Use drm sched lockdep map for submit_wq Matthew Brost
2024-08-12 5:35 ` Ghimiray, Himal Prasad
2024-08-13 19:16 ` Matthew Brost [this message]
2024-08-19 8:11 ` Ghimiray, Himal Prasad
2024-08-09 22:28 ` [PATCH v3 5/5] drm/xe: Drop GuC submit_wq pool Matthew Brost
2024-08-09 23:07 ` ✓ CI.Patch_applied: success for Use user-defined workqueue lockdep map for drm sched (rev3) Patchwork
2024-08-09 23:08 ` ✓ CI.checkpatch: " Patchwork
2024-08-09 23:09 ` ✓ CI.KUnit: " Patchwork
2024-08-09 23:20 ` ✓ CI.Build: " Patchwork
2024-08-09 23:23 ` ✓ CI.Hooks: " Patchwork
2024-08-09 23:24 ` ✗ CI.checksparse: warning " Patchwork
2024-08-09 23:55 ` ✗ CI.BAT: failure " Patchwork
2024-08-10 2:53 ` ✗ CI.FULL: " Patchwork
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=ZruxG8YaHqV1CAgS@DUT025-TGLU.fm.intel.com \
--to=matthew.brost@intel.com \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ltuikov89@gmail.com \
--cc=tj@kernel.org \
/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