On 11/24/25 12:30, Pavel Begunkov wrote:
On 11/24/25 10:33, Christian König wrote:
On 11/23/25 23:51, Pavel Begunkov wrote:
Picking up the work on supporting dmabuf in the read/write path.
IIRC that work was completely stopped because it violated core dma_fence and DMA-buf rules and after some private discussion was considered not doable in general.
Or am I mixing something up here?
The time gap is purely due to me being busy. I wasn't CC'ed to those private discussions you mentioned, but the v1 feedback was to use dynamic attachments and avoid passing dma address arrays directly.
https://lore.kernel.org/all/cover.1751035820.git.asml.silence@gmail.com/
I'm lost on what part is not doable. Can you elaborate on the core dma-fence dma-buf rules?
I most likely mixed that up, in other words that was a different discussion.
When you use dma_fences to indicate async completion of events you need to be super duper careful that you only do this for in flight events, have the fence creation in the right order etc...
For example once the fence is created you can't make any memory allocations any more, that's why we have this dance of reserving fence slots, creating the fence and then adding it.
Since I don't see any dma_fence implementation at all that might actually be the case.
See Patch 5, struct blk_mq_dma_fence. It's used in the move_notify callback and is signaled when all inflight IO using the current mapping are complete. All new IO requests will try to recreate the mapping, and hence potentially wait with dma_resv_wait_timeout().
Without looking at the code that approach sounds more or less correct to me.
On the other hand we have direct I/O from DMA-buf working for quite a while, just not upstream and without io_uring support.
Have any reference?
There is a WIP feature in AMDs GPU driver package for ROCm.
But that can't be used as general purpose DMA-buf approach, because it makes use of internal knowledge about how the GPU driver is using the backing store.
BTW when you use DMA addresses from DMA-buf always keep in mind that this memory can be written by others at the same time, e.g. you can't do things like compute a CRC first, then write to backing store and finally compare CRC.
Regards, Christian.
linaro-mm-sig@lists.linaro.org