All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] rust: drm: gpuvm: implement Send and Sync for refcounted handles
@ 2026-06-09  0:32 Sami Tolvanen
  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
  0 siblings, 2 replies; 6+ messages in thread
From: Sami Tolvanen @ 2026-06-09  0:32 UTC (permalink / raw)
  To: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Danilo Krummrich
  Cc: Sami Tolvanen, rust-for-linux

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-06-10  7:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09  0:32 [PATCH v3 0/2] rust: drm: gpuvm: implement Send and Sync for refcounted handles Sami Tolvanen
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  0:49   ` sashiko-bot
2026-06-09  1:54   ` Sami Tolvanen
2026-06-10  7:13     ` Alice Ryhl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.