drm/gpuvm: avoid deferred cleanup on GpuVmBoAlloc drop
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | drm/gpuvm: export drm_gpuvm_bo_destroy_not_in_lists()drivers/ include/ | +5 | 0 replies | |
| 2/2 | rust: drm: gpuvm: call drm_gpuvm_bo_destroy_not_in_lists() in Droprust/ | +7 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] drm/gpuvm: avoid deferred cleanup on GpuVmBoAlloc drop
GpuVmBoAlloc::drop() (rust/kernel/drm/gpuvm/vm_bo.rs) currently releases its drm_gpuvm_bo via drm_gpuvm_bo_put_deferred(), which exists to handle destruction from contexts where the GEM's gpuva lock cannot be taken synchronously. However, a GpuVmBoAlloc has a refcount of one and is never added to the gem, extobj, or evict lists by construction. Therefore, a GpuVmBoAlloc that is dropped without being consumed by obtain() does not require a deferred put.
drm_gpuvm_bo_obtain_prealloc() currently handles this situation internally, where it discards the losing preallocated drm_gpuvm_bo by unlocking obj->gpuva.lock and calling drm_gpuvm_bo_destroy_not_in_lists() directly, which skips the deferred path.
This series lets GpuVmBoAlloc::drop() behave the same:
1/2: exports drm_gpuvm_bo_destroy_not_in_lists() so it can be called from the Rust binding, and promotes its comment to kernel-doc.
2/2: switches GpuVmBoAlloc::drop() to call it directly, and includes the safety argument for why its precondition holds. Drops the TODO left previously.
Note: there is currently no in-tree caller of GpuVm::obtain(), so the drop path isn't currently exercised by an existing driver.
Daniel Pesic (2):
drm/gpuvm: export drm_gpuvm_bo_destroy_not_in_lists()
rust: drm: gpuvm: call drm_gpuvm_bo_destroy_not_in_lists() in Drop
drivers/gpu/drm/drm_gpuvm.c | 5 +++-- include/drm/drm_gpuvm.h | 2 ++ rust/kernel/drm/gpuvm/vm_bo.rs | 10 +++++++--- 3 files changed, 12 insertions(+), 5 deletions(-)
Signature · 1 line
2.55.0