From: Danilo Krummrich <dakr@kernel.org>
To: Matthew Brost <matthew.brost@intel.com>
Cc: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
pstanner@redhat.com, ltuikov89@gmail.com
Subject: Re: [PATCH v4 1/2] drm/sched: Use drm sched lockdep map for submit_wq
Date: Wed, 2 Oct 2024 16:16:00 +0200 [thread overview]
Message-ID: <Zv1VoJ_KEw1-P257@pollux> (raw)
In-Reply-To: <20241002131639.3425022-2-matthew.brost@intel.com>
On Wed, Oct 02, 2024 at 06:16:38AM -0700, 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>
Good catch,
Acked-by: Danilo Krummrich <dakr@kernel.org>
> ---
> 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 36db5c7736fc..e32b0f7d7e94 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)
>
> @@ -1270,7 +1276,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;
>
> --
> 2.34.1
>
next prev parent reply other threads:[~2024-10-02 14:16 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-02 13:16 [PATCH v4 0/2] Use user-defined workqueue lockdep map for drm sched Matthew Brost
2024-10-02 13:16 ` [PATCH v4 1/2] drm/sched: Use drm sched lockdep map for submit_wq Matthew Brost
2024-10-02 14:14 ` Nirmoy Das
2024-10-02 14:16 ` Danilo Krummrich [this message]
2024-10-02 15:00 ` Matthew Brost
2024-10-02 15:13 ` Danilo Krummrich
2024-10-03 3:29 ` Ghimiray, Himal Prasad
2024-10-02 13:16 ` [PATCH v4 2/2] drm/xe: Drop GuC submit_wq pool Matthew Brost
2024-10-02 14:15 ` Nirmoy Das
2024-10-03 3:30 ` Ghimiray, Himal Prasad
2024-10-02 14:30 ` ✓ CI.Patch_applied: success for Use user-defined workqueue lockdep map for drm sched Patchwork
2024-10-02 14:31 ` ✓ CI.checkpatch: " Patchwork
2024-10-02 14:33 ` ✓ CI.KUnit: " Patchwork
2024-10-02 14:51 ` ✓ CI.Build: " Patchwork
2024-10-02 14:53 ` ✓ CI.Hooks: " Patchwork
2024-10-02 14:54 ` ✓ CI.checksparse: " Patchwork
2024-10-02 15:29 ` ✓ CI.BAT: " Patchwork
2024-10-02 18:44 ` ✗ CI.FULL: failure " 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=Zv1VoJ_KEw1-P257@pollux \
--to=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=ltuikov89@gmail.com \
--cc=matthew.brost@intel.com \
--cc=pstanner@redhat.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;
as well as URLs for NNTP newsgroup(s).