Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Refcounting dma_resv v2
@ 2026-08-27 12:38 Christian König
  2026-08-27 12:38 ` [PATCH 01/10] dma-buf: Add reference counting to dma_resv Christian König
                   ` (10 more replies)
  0 siblings, 11 replies; 25+ messages in thread
From: Christian König @ 2026-08-27 12:38 UTC (permalink / raw)
  To: thomas.hellstrom, dakr, ecourtney, matthew.brost, nat, dri-devel,
	intel-gfx, intel-xe, amd-gfx

Hi everybody,

The idea of ref-counting dma_resv or ww_mutex came up multiple times from
different people, but so far at least I have abandoned that as to
complicated to implement considering how widely used that object is.

Thanks to AI I gave the task to refcount dma_resv to Claude Sonet 4 just
to check how horrible it would look like.

Well turns out that this is actually a cleanup we should most likely aim
for and I'm really wondering why we haven't done it like this in the
first place.

Not only resolves it a bunch of issues with dma_resv instances shared by
multiple GEM objects (we just recently had a bunch of patches for that on
the mailing list), but also allows TTM to implement it's delayed delete
handling without any zombie resurrection or similar hacks and DMA-buf to
have better contention handling on map/pin in the future.

This patch set here is now the idea full flashed out. I smoke tested it
with amdgpu, self tests and checked everything with kmemleak and of hand
it seems to work.

Patch #1 introduces an interim allocated flag to allow switching users
over to the new interface one by one. Patch #10 then removes that flag
again after everything is done.

While AI is an automated tool I distrust it to always generate the same
code. So better using a defensive approach on changing things.

Please review and comment.

Cheers,
Christian.


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

end of thread, other threads:[~2026-08-28 19:34 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-27 12:38 Refcounting dma_resv v2 Christian König
2026-08-27 12:38 ` [PATCH 01/10] dma-buf: Add reference counting to dma_resv Christian König
2026-08-27 18:39   ` Andi Shyti
2026-08-28 18:21   ` Danilo Krummrich
2026-08-28 19:17     ` Matthew Brost
2026-08-28 19:34       ` Matthew Brost
2026-08-27 12:38 ` [PATCH 02/10] dma-buf/tests: Convert st-dma-resv tests to use dma_resv_alloc Christian König
2026-08-27 13:08   ` sashiko-bot
2026-08-27 12:38 ` [PATCH 03/10] drm/gem: Add helper for drm_gem_object resv assignment Christian König
2026-08-27 13:22   ` sashiko-bot
2026-08-27 12:38 ` [PATCH 04/10] drm/gem: Convert drm_gem_private_object_init to return error code Christian König
2026-08-27 13:19   ` sashiko-bot
2026-08-27 12:38 ` [PATCH 05/10] drm/gem: Use dynamic allocation for GEM object dma_resv Christian König
2026-08-27 13:13   ` sashiko-bot
2026-08-27 12:38 ` [PATCH 06/10] drm/mode_config: Use dma_resv_alloc for lockdep annotation Christian König
2026-08-27 13:02   ` sashiko-bot
2026-08-27 12:38 ` [PATCH 07/10] drm/xe: " Christian König
2026-08-27 13:04   ` sashiko-bot
2026-08-27 12:38 ` [PATCH 08/10] drm/i915/gt: Use dma_resv_alloc for VM reservation objects Christian König
2026-08-27 13:11   ` sashiko-bot
2026-08-27 12:38 ` [PATCH 09/10] drm/ttm/tests: Use dma_resv_alloc in test files Christian König
2026-08-27 13:12   ` sashiko-bot
2026-08-27 12:38 ` [PATCH 10/10] dma-buf: Inline dma_resv_init and remove allocated flag Christian König
2026-08-27 13:31   ` sashiko-bot
2026-08-27 13:39 ` ✗ Fi.CI.BUILD: failure for series starting with [01/10] dma-buf: Add reference counting to dma_resv Patchwork

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