Rust for Linux List
 help / color / mirror / Atom feed
* [PATCH v4 0/2] rust: drm: gpuvm: implement Send and Sync for refcounted handles
@ 2026-06-11 22:17 Sami Tolvanen
  2026-06-11 22:17 ` [PATCH v4 1/2] rust: drm: gpuvm: require Send + Sync for the driver's associated data Sami Tolvanen
  2026-06-11 22:17 ` [PATCH v4 2/2] rust: drm: gpuvm: implement Send and Sync for GpuVaAlloc and GpuVmBo Sami Tolvanen
  0 siblings, 2 replies; 3+ messages in thread
From: Sami Tolvanen @ 2026-06-11 22:17 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: Deborah Brouwer, 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.

Path 1 requires Send + Sync on DriverGpuVm and its associated data
instead of bounding each impl separately, as discussed in the v3
thread. Patch 2 adds bounds for GpuVaAlloc and GpuVmBo.

This series is based on Deborah's DeviceContext patch as they would
otherwise conflict:

https://lore.kernel.org/rust-for-linux/20260610-gpuvm_device_context_v1-v1-1-01a890b17448@collabora.com/

Sami

---
v4:
- Moved the bounds to the DriverGpuVm trait as discussed in the
  v3 thread, and reordered the series.
- Added Send for VaData as pointed out by Sashiko again.
- Rebased on top of Deborah's DeviceContext patch.

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: require Send + Sync for the driver's associated data
      rust: drm: gpuvm: implement Send and Sync for GpuVaAlloc and GpuVmBo

 rust/kernel/drm/gpuvm/mod.rs   | 26 +++++++++++++++-----------
 rust/kernel/drm/gpuvm/va.rs    |  8 ++++++++
 rust/kernel/drm/gpuvm/vm_bo.rs |  9 +++++++++
 3 files changed, 32 insertions(+), 11 deletions(-)
---
base-commit: 550dc7536644db2d67c6f8cf525bba682fba08d9
change-id: 20260611-gpuvm-sync-send-aa47a9001ae6
prerequisite-change-id: 20260610-gpuvm_device_context_v1-367c21f94e1e:v1
prerequisite-patch-id: eb2074676db5d923c8505208388fd1c0dba58b6a

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

end of thread, other threads:[~2026-06-11 22:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-11 22:17 [PATCH v4 0/2] rust: drm: gpuvm: implement Send and Sync for refcounted handles Sami Tolvanen
2026-06-11 22:17 ` [PATCH v4 1/2] rust: drm: gpuvm: require Send + Sync for the driver's associated data Sami Tolvanen
2026-06-11 22:17 ` [PATCH v4 2/2] rust: drm: gpuvm: implement Send and Sync for GpuVaAlloc and GpuVmBo Sami Tolvanen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox