Skip to content

allow dma-buf-io ctx reuse across files

Pavel Begunkov dri-devel io-uring linux-block linux-fsdevel linux-media 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5dma-buf-io: add tags for sharing ctx b/w filesdrivers/dma-buf/dma-buf-io.c include/linux/dma-buf-io.h include/linux/fs.h+31 -00 replies
2/5block: set dma-buf-io tag to block filesblock/fops.c+1 -00 replies
3/5io_uring: add data to dma-buf convertion helpersio_uring/dma-buf.c io_uring/dma-buf.h+13 -30 replies
4/5io_uring/dma-buf: switch to tag file filteringio_uring/dma-buf.c io_uring/dma-buf.h+3 -60 replies
5/5io_uring/dma-buf: get rid of struct io_buf_dmaio_uring/dma-buf.c io_uring/dma-buf.h+10 -220 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] allow dma-buf-io ctx reuse across files

Currently, dma-buf maps can only be used by the file they were registered with. This means that we can't open a new file, even if it comes from the same subsystem and point to the same block device and use it with an old dma-buf registration. That would be too restrictive for upcoming filsystem support, so lift it now and allow reusing contexts between files pointing to the same NVMe, even if they refer to different partitions.

To do that, we add a tag representing for each file, save it from the file passed during registration and use it to reject files which tags don't match it. Tags are set by subsystems creating files, should be unique and represent the instance of the subsystem.

Pavel Begunkov (5):
dma-buf-io: add tags for sharing ctx b/w files
block: set dma-buf-io tag to block files
io_uring: add data to dma-buf convertion helpers io_uring/dma-buf: switch to tag file filtering io_uring/dma-buf: get rid of struct io_buf_dma

 block/fops.c                 |  1 +
 drivers/dma-buf/dma-buf-io.c |  3 +++
 include/linux/dma-buf-io.h   | 22 ++++++++++++++++++++++
 include/linux/fs.h           |  6 ++++++
 io_uring/dma-buf.c           | 19 +++++--------------
 io_uring/dma-buf.h           | 24 ++++++++++++++----------
 6 files changed, 51 insertions(+), 24 deletions(-)
Signature · 1 line
2.54.0