From: Philipp Stanner <pstanner@redhat.com>
To: Matthew Brost <matthew.brost@intel.com>,
intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Cc: jiangshanlai@gmail.com, tj@kernel.org, simona.vetter@ffwll.ch,
christian.koenig@amd.com, dakr@kernel.org
Subject: Re: [RFC PATCH 2/3] drm/sched: Taint workqueues with reclaim
Date: Mon, 27 Oct 2025 12:03:33 +0100 [thread overview]
Message-ID: <2336a1282aa6a44f23a9100d2553b8032f44f3bd.camel@redhat.com> (raw)
In-Reply-To: <20251021213952.746900-3-matthew.brost@intel.com>
On Tue, 2025-10-21 at 14:39 -0700, Matthew Brost wrote:
> Multiple drivers seemingly do not understand the role of DMA fences in
> the reclaim path. As a result,
>
result of what? The "role of DMA fences"?
> DRM scheduler workqueues, which are part
> of the fence signaling path, must not allocate memory.
>
Should be phrased differently. The actual rule here is "The GPU
scheduler's workqueues can be used for memory reclaim. Because of that,
work items on these queues must not allocate memory."
--
In general, I often read in commits or discussions about this or that
"rule", especially "DMA fence rules", but they're often not detailed
very much.
P.
> This patch
> teaches lockdep to recognize these rules in order to catch driver-side
> bugs.
>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Danilo Krummrich <dakr@kernel.org>
> Cc: Matthew Brost <matthew.brost@intel.com>
> Cc: Philipp Stanner <phasta@kernel.org>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> ---
> drivers/gpu/drm/scheduler/sched_main.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
> index c39f0245e3a9..676484dd3ea3 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -1368,6 +1368,9 @@ int drm_sched_init(struct drm_gpu_scheduler *sched, const struct drm_sched_init_
> atomic64_set(&sched->job_id_count, 0);
> sched->pause_submit = false;
>
> + taint_reclaim_workqueue(sched->submit_wq, GFP_KERNEL);
> + taint_reclaim_workqueue(sched->timeout_wq, GFP_KERNEL);
> +
> sched->ready = true;
> return 0;
> Out_unroll:
next prev parent reply other threads:[~2025-10-27 11:03 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-21 21:39 [RFC PATCH 0/3] Enforce DRM scheduler reclaim rules Matthew Brost
2025-10-21 21:39 ` [RFC PATCH 1/3] workqueue: Add an interface to taint workqueue lockdep with reclaim Matthew Brost
2025-10-21 21:56 ` Tejun Heo
2025-10-21 22:04 ` Matthew Brost
2025-10-21 22:06 ` Matthew Brost
2025-10-21 23:25 ` Tejun Heo
2025-10-22 1:16 ` Matthew Brost
2025-10-21 23:28 ` Tejun Heo
2025-10-22 1:22 ` Matthew Brost
2025-10-22 1:51 ` Tejun Heo
2025-10-27 21:58 ` Matthew Brost
2025-10-28 9:32 ` Christian König
2025-10-28 20:16 ` Matthew Brost
2025-10-29 9:48 ` Christian König
2025-10-29 15:06 ` Tejun Heo
2025-10-29 16:46 ` Matthew Brost
2025-10-29 18:16 ` Tejun Heo
2025-10-21 21:39 ` [RFC PATCH 2/3] drm/sched: Taint workqueues " Matthew Brost
2025-10-27 11:03 ` Philipp Stanner [this message]
2025-10-27 17:00 ` Matthew Brost
2025-10-21 21:39 ` [RFC PATCH 3/3] drm/sched: Prevent adding dependencies to an armed job Matthew Brost
2025-10-27 11:13 ` Philipp Stanner
2025-10-27 16:56 ` Matthew Brost
2025-10-28 9:27 ` Philipp Stanner
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=2336a1282aa6a44f23a9100d2553b8032f44f3bd.camel@redhat.com \
--to=pstanner@redhat.com \
--cc=christian.koenig@amd.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.brost@intel.com \
--cc=simona.vetter@ffwll.ch \
--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
all inboxes | Powered by JetHome®