From: "Danilo Krummrich" <dakr@kernel.org>
To: "Philipp Stanner" <phasta@mailbox.org>
Cc: phasta@kernel.org, "Gary Guo" <gary@garyguo.net>,
"Alice Ryhl" <aliceryhl@google.com>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Christian König" <christian.koenig@amd.com>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Trevor Gross" <tmgross@umich.edu>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Tamir Duberstein" <tamird@kernel.org>,
"Alexandre Courbot" <acourbot@nvidia.com>,
"Onur Özkan" <work@onurozkan.dev>,
linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rust: DmaFence: Add better warning through Device reference
Date: Fri, 25 Sep 2026 19:32:49 +0200 [thread overview]
Message-ID: <DLOKSGU61PUG.WSZBN04H0A2Q@kernel.org> (raw)
In-Reply-To: <ab1241777ac432666bb1564d875211bf142a6398.camel@mailbox.org>
On Fri Sep 25, 2026 at 7:21 PM CEST, Philipp Stanner wrote:
> On Fri, 2026-09-25 at 17:50 +0200, Danilo Krummrich wrote:
>> On Fri Sep 25, 2026 at 3:08 PM CEST, Philipp Stanner wrote:
>> > The driver can avoid dropping half-forgotten stuff by calling
>> > jobqueue.complete_all_jobs(ECANCELED) immediately before dropping,
>> > which allows us for having the warning without false-positives.
>>
>> This would just move it up a layer from inventing a new type around DriverFence
>> to invent a new type around Jobqueue which does that instead.
>>
>> But the Jobqueue won't have any procedural teardown, it has to teardown stuff in
>> drop() anyway, which includes dropping jobs already.
>>
>> What I'm saying is that there's not much value in DriverFence::drop() having
>> this warning in the first place, which then either the driver or the jobqueue
>> has to work around on teardown.
>
> I guess we agree that it would be a horrible bug if there's still a
> command buffer running on the GPU that can access memory which might
> have been freed once the associated fence signaled.
Sure, but that's unrelated.
> So I suppose what you are saying is more: there is not much value in
> the case of *JobQueue*, basically because all the jobs live inside of
> it anyways.
No, I'm saying there is not much value in general. Whatever thing owns the
DriverFence has to represent the "device access" of some resource, which
already naturally establishes the relationship.
IOW, whatever thing owns a DriverFence is also the thing that stops the hardware
in its own drop() implementation; anything else would be rather questionable.
> So I suppose we agree that a warning is fine. It won't fire in JQ
> anyways, but might benefit others.
What scenario are you thinking of?
next prev parent reply other threads:[~2026-09-25 17:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 8:19 Philipp Stanner
2026-09-25 10:26 ` Gary Guo
2026-09-25 12:30 ` Danilo Krummrich
2026-09-25 13:08 ` Philipp Stanner
2026-09-25 15:50 ` Danilo Krummrich
2026-09-25 17:21 ` Philipp Stanner
2026-09-25 17:32 ` Danilo Krummrich [this message]
2026-09-25 16:00 ` Danilo Krummrich
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=DLOKSGU61PUG.WSZBN04H0A2Q@kernel.org \
--to=dakr@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=christian.koenig@amd.com \
--cc=daniel.almeida@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=phasta@kernel.org \
--cc=phasta@mailbox.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=sumit.semwal@linaro.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
/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®