All of lore.kernel.org
 help / color / mirror / Atom feed
* completely rework the dma_resv semantic
@ 2021-12-07 12:33 Christian König
  2021-12-07 12:33 ` [PATCH 01/24] dma-buf: add dma_resv_replace_fences Christian König
                   ` (24 more replies)
  0 siblings, 25 replies; 107+ messages in thread
From: Christian König @ 2021-12-07 12:33 UTC (permalink / raw)
  To: daniel, dri-devel, linux-media, linaro-mm-sig

Hi Daniel,

just a gentle ping that you wanted to take a look at this.

Not much changed compared to the last version, only a minor bugfix in
the dma_resv_get_singleton error handling.

Regards,
Christian.



^ permalink raw reply	[flat|nested] 107+ messages in thread
* completely rework the dma_resv semantic
@ 2022-02-11 12:49 Christian König
  2022-02-18 11:03 ` Christian König
  0 siblings, 1 reply; 107+ messages in thread
From: Christian König @ 2022-02-11 12:49 UTC (permalink / raw)
  To: daniel, sumit.semwal, dri-devel, linaro-mm-sig

Hi guys,

by now that should be a rather well known set of changes.

The basic idea is that instead of the fixed exclusive/shared classes we now
attach an usage to each fence in the dma_resv object describing how the
operation represented by the fence is using the resources protected by
the dma_resv.

I've addressed quite a bunch of comments already and I think this set has
already been discussed quite well now. As improvement to the last version
I've now added CCs for all the relevant maintainers to the patches changing
some functionality inside drivers.

Please review and comment,
Christian.



^ permalink raw reply	[flat|nested] 107+ messages in thread
* completely rework the dma_resv semantic
@ 2021-11-29 12:06 ` Christian König
  0 siblings, 0 replies; 107+ messages in thread
From: Christian König @ 2021-11-29 12:06 UTC (permalink / raw)
  To: daniel; +Cc: linaro-mm-sig, dri-devel, linux-media

Hi everyone,

compared to the last version I've dropped the pruning as suggested by
Maarten, split the new DMA_RESV_USAGE_* patches from the general
introduction as suggeted by Daniel and renamed OTEHRS to BOOKKEEP as
suggested by Pekka.

Please take a look and review,
Christian.



^ permalink raw reply	[flat|nested] 107+ messages in thread
* completely rework the dma_resv semantic
@ 2021-11-23 14:20 ` Christian König
  0 siblings, 0 replies; 107+ messages in thread
From: Christian König @ 2021-11-23 14:20 UTC (permalink / raw)
  To: sumit.semwal, daniel; +Cc: linux-media, dri-devel, linaro-mm-sig

Hi guys,

as discussed before this set of patches completely rework the dma_resv semantic
and spreads the new handling over all the existing drivers and users.

First of all this drops the DAG approach because it requires that every single
driver implements those relatively complicated rules correctly and any
violation of that immediately leads to either corruption of freed memory or
even more severe security problems.

Instead we just keep all fences around all the time until they are signaled.
Only fences with the same context are assumed to be signaled in the correct
order since this is exercised elsewhere as well. Replacing fences is now only
supported for hardware mechanism like VM page table updates where the hardware
can guarantee that the resource can't be accessed any more.

Then the concept of a single exclusive fence and multiple shared fences is
dropped as well.

Instead the dma_resv object is now just a container for dma_fence objects where
each fence has associated usage flags. Those use flags describe how the
operation represented by the dma_fence object is using the resource protected
by the dma_resv object. This allows us to add multiple fences for each usage
type.

Additionally to the existing WRITE/READ usages this patch set also adds the new
KERNEL and OTHER usages. The KERNEL usages is used in cases where the kernel
needs to do some operation with the resource protected by the dma_resv object,
like copies or clears. Those are mandatory to wait for when dynamic memory
management is used.

The OTHER usage is for cases where we don't want that the operation represented
by the dma_fence object participate in any implicit sync but needs to be
respected by the kernel memory management. Examples for those are VM page table
updates and preemption fences.

While doing this the new implementation cleans up existing workarounds all over
the place, but especially amdgpu and TTM. Surprisingly I also found two use
cases for the KERNEL/OTHER usage in i915 and Nouveau, those might need more
thoughts.

In general the existing functionality should been preserved, the only downside
is that we now always need to reserve a slot before adding a fence. The newly
added call to the reservation function can probably use some more cleanup.

TODOs: Testing, testing, testing, doublechecking the newly added
kerneldoc for any typos.

Please review and/or comment,
Christian.



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

end of thread, other threads:[~2022-03-03 13:49 UTC | newest]

Thread overview: 107+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-07 12:33 completely rework the dma_resv semantic Christian König
2021-12-07 12:33 ` [PATCH 01/24] dma-buf: add dma_resv_replace_fences Christian König
2021-12-22 21:05   ` Daniel Vetter
2021-12-22 21:05     ` Daniel Vetter
2022-01-03 10:48     ` Christian König
2022-01-03 10:48       ` Christian König
2022-01-14 16:28       ` Daniel Vetter
2022-01-14 16:28         ` Daniel Vetter
2021-12-07 12:33 ` [PATCH 02/24] dma-buf: finally make the dma_resv_list private Christian König
2021-12-22 21:08   ` Daniel Vetter
2021-12-22 21:08     ` Daniel Vetter
2021-12-07 12:33 ` [PATCH 03/24] dma-buf: drop excl_fence parameter from dma_resv_get_fences Christian König
2021-12-22 21:13   ` Daniel Vetter
2021-12-22 21:13     ` Daniel Vetter
2021-12-07 12:33 ` [PATCH 04/24] dma-buf: add dma_resv_get_singleton v2 Christian König
2021-12-22 21:21   ` Daniel Vetter
2021-12-22 21:21     ` Daniel Vetter
2022-01-03 11:13     ` Christian König
2022-01-03 11:13       ` Christian König
2022-01-14 16:31       ` Daniel Vetter
2022-01-14 16:31         ` Daniel Vetter
2022-01-17 11:26         ` Christian König
2022-01-17 11:26           ` Christian König
2022-03-02 17:39           ` Jason Ekstrand
2021-12-07 12:33 ` [PATCH 05/24] RDMA: use dma_resv_wait() instead of extracting the fence Christian König
2021-12-22 21:23   ` Daniel Vetter
2021-12-22 21:23     ` Daniel Vetter
2021-12-07 12:33 ` [PATCH 06/24] drm/etnaviv: stop using dma_resv_excl_fence Christian König
2021-12-22 21:26   ` Daniel Vetter
2021-12-22 21:26     ` Daniel Vetter
2021-12-07 12:33 ` [PATCH 07/24] drm/nouveau: " Christian König
2021-12-22 21:26   ` Daniel Vetter
2021-12-22 21:26     ` Daniel Vetter
2021-12-07 12:33 ` [PATCH 08/24] drm/vmwgfx: " Christian König
2021-12-22 21:31   ` Daniel Vetter
2021-12-22 21:31     ` Daniel Vetter
2021-12-07 12:33 ` [PATCH 09/24] drm/radeon: " Christian König
2021-12-22 21:30   ` Daniel Vetter
2021-12-22 21:30     ` Daniel Vetter
2021-12-07 12:33 ` [PATCH 10/24] drm/amdgpu: remove excl as shared workarounds Christian König
2021-12-22 21:34   ` Daniel Vetter
2021-12-22 21:34     ` Daniel Vetter
2021-12-07 12:33 ` [PATCH 11/24] drm/amdgpu: use dma_resv_for_each_fence for CS workaround Christian König
2021-12-22 21:37   ` Daniel Vetter
2021-12-22 21:37     ` Daniel Vetter
2022-01-03 12:24     ` Christian König
2022-01-03 12:24       ` Christian König
2021-12-07 12:33 ` [PATCH 12/24] dma-buf: finally make dma_resv_excl_fence private Christian König
2021-12-22 21:39   ` Daniel Vetter
2021-12-22 21:39     ` Daniel Vetter
2021-12-07 12:34 ` [PATCH 13/24] dma-buf: drop the DAG approach for the dma_resv object Christian König
2021-12-22 21:43   ` Daniel Vetter
2021-12-22 21:43     ` Daniel Vetter
2022-01-04 15:08     ` Christian König
2022-01-04 15:08       ` Christian König
2022-01-14 16:33       ` Daniel Vetter
2022-01-14 16:33         ` Daniel Vetter
2021-12-07 12:34 ` [PATCH 14/24] dma-buf/drivers: make reserving a shared slot mandatory v2 Christian König
2021-12-22 21:50   ` Daniel Vetter
2021-12-22 21:50     ` Daniel Vetter
2021-12-07 12:34 ` [PATCH 15/24] drm: support more than one write fence in drm_gem_plane_helper_prepare_fb Christian König
2021-12-22 21:51   ` Daniel Vetter
2021-12-22 21:51     ` Daniel Vetter
2021-12-07 12:34 ` [PATCH 16/24] drm/nouveau: support more than one write fence in fenv50_wndw_prepare_fb Christian König
2021-12-22 21:52   ` Daniel Vetter
2021-12-22 21:52     ` Daniel Vetter
2021-12-07 12:34 ` [PATCH 17/24] drm/amdgpu: use dma_resv_get_singleton in amdgpu_pasid_free_cb Christian König
2021-12-22 21:53   ` Daniel Vetter
2021-12-22 21:53     ` Daniel Vetter
2021-12-07 12:34 ` [PATCH 18/24] dma-buf: add enum dma_resv_usage v3 Christian König
2021-12-22 22:00   ` Daniel Vetter
2021-12-22 22:00     ` Daniel Vetter
2022-03-02 17:55     ` Jason Ekstrand
2022-03-03 13:13       ` Christian König
2021-12-07 12:34 ` [PATCH 19/24] dma-buf: specify usage while adding fences to dma_resv obj v2 Christian König
2021-12-07 12:34 ` [PATCH 20/24] dma-buf: add DMA_RESV_USAGE_KERNEL Christian König
2021-12-22 22:05   ` Daniel Vetter
2021-12-22 22:05     ` Daniel Vetter
2022-03-02 18:11     ` Jason Ekstrand
2022-03-03 13:49       ` Christian König
2021-12-07 12:34 ` [PATCH 21/24] dma-buf: add DMA_RESV_USAGE_BOOKKEEP Christian König
2021-12-22 22:10   ` Daniel Vetter
2021-12-22 22:10     ` Daniel Vetter
2021-12-07 12:34 ` [PATCH 22/24] dma-buf: wait for map to complete for static attachments Christian König
2021-12-22 22:16   ` Daniel Vetter
2021-12-22 22:16     ` Daniel Vetter
2021-12-07 12:34 ` [PATCH 23/24] amdgpu: remove DMA-buf fence workaround Christian König
2021-12-07 12:34 ` [PATCH 24/24] drm/ttm: remove bo->moving Christian König
2021-12-17 14:39 ` completely rework the dma_resv semantic Christian König
2021-12-22 22:17   ` Daniel Vetter
2021-12-22 22:17     ` Daniel Vetter
2021-12-23  9:11     ` Christian König
2021-12-23  9:11       ` Christian König
2022-01-14 16:35       ` Daniel Vetter
2022-01-14 16:35         ` Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2022-02-11 12:49 Christian König
2022-02-18 11:03 ` Christian König
2021-11-29 12:06 Christian König
2021-11-29 12:06 ` Christian König
2021-11-23 14:20 Christian König
2021-11-23 14:20 ` Christian König
2021-11-24  8:31 ` Pekka Paalanen
2021-11-24  8:31   ` Pekka Paalanen
2021-11-24  8:39   ` Christian König
2021-11-24  8:39     ` Christian König
2021-11-25 16:04 ` Daniel Vetter
2021-11-25 16:04   ` Daniel Vetter

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.