BACKPORT: bpf: Add dmabuf iterator
The dmabuf iterator traverses the list of all DMA buffers. DMA buffers are refcounted through their associated struct file. A reference is taken on each buffer as the list is iterated to ensure each buffer persists for the duration of the bpf program execution without holding the list mutex. Signed-off-by:T.J. Mercier <tjmercier@google.com> Reviewed-by:
Christian König <christian.koenig@amd.com> Acked-by:
Song Liu <song@kernel.org> Link: https://lore.kernel.org/r/20250522230429.941193-3-tjmercier@google.com Signed-off-by:
Alexei Starovoitov <ast@kernel.org> (cherry picked from commit 76ea9553) [TJ: file_ref_get -> atomic_long_inc_not_zero. This is safe under the dmabuf_list_mutex because dma_buf_file_release takes that lock before removing the buffer from the list and freeing the file. The direct atomic call avoids unnecessary overhead in get_file_active.] Bug: 442852262 Change-Id: Iaeda328f7693acc1506269c12cac5e7955e5c091
Loading
Please sign in to comment