From: Sami Tolvanen <samitolvanen@google.com>
To: "Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>
Cc: Sami Tolvanen <samitolvanen@google.com>, rust-for-linux@vger.kernel.org
Subject: [PATCH v3 0/2] rust: drm: gpuvm: implement Send and Sync for refcounted handles
Date: Tue, 9 Jun 2026 00:32:57 +0000 [thread overview]
Message-ID: <20260609003256.1829625-4-samitolvanen@google.com> (raw)
Hi folks,
GpuVaAlloc and GpuVmBo implement neither Send or Sync, so drivers
that move them between threads need their own unsafe impls. GpuVm
implements both unconditionally, which Sashiko points out is unsound.
Patch 1 adds Send and Sync for GpuVaAlloc (unconditionally) and
GpuVmBo (similarly to Arc). Patch 2 gives GpuVm the same bounds as
it can alias types using obtain() and drop them across the threads
via deferred_cleanup().
Tested with downstream Tyr as there don't appear to be any in-tree
users yet.
Sami
---
v3:
- Added a patch for GpuVm, and changed GpuVmBo bounds based on
another Sashiko analysis.
v2:
- Added a missing T::Object: Send + Sync bound pointed out by
Sashiko.
---
Sami Tolvanen (2):
rust: drm: gpuvm: implement Send and Sync for GpuVaAlloc and GpuVmBo
rust: drm: gpuvm: require Send and Sync for GpuVm's shared data
rust/kernel/drm/gpuvm/mod.rs | 22 +++++++++++++++++++---
rust/kernel/drm/gpuvm/va.rs | 8 ++++++++
rust/kernel/drm/gpuvm/vm_bo.rs | 22 ++++++++++++++++++++++
3 files changed, 49 insertions(+), 3 deletions(-)
base-commit: fea3a2dd7d3fc1936211ced5f84420e610435730
--
2.54.0.1099.g489fc7bff1-goog
next reply other threads:[~2026-06-09 0:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 0:32 Sami Tolvanen [this message]
2026-06-09 0:32 ` [PATCH v3 1/2] rust: drm: gpuvm: implement Send and Sync for GpuVaAlloc and GpuVmBo Sami Tolvanen
2026-06-09 0:32 ` [PATCH v3 2/2] rust: drm: gpuvm: require Send and Sync for GpuVm's shared data Sami Tolvanen
2026-06-09 1:54 ` Sami Tolvanen
2026-06-10 7:13 ` Alice Ryhl
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=20260609003256.1829625-4-samitolvanen@google.com \
--to=samitolvanen@google.com \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=gary@garyguo.net \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
/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