Hello Jens, This patch tries to address limitation from in-tree ublk zero copy: - one IO needs two extra uring_cmd for register/unregister bvec buffer, not efficient - introduced dependency on the two uring_cmd, so the buffer consumer has to linked with the two uring_cmd, hard to use & less efficient This patchset adds feature UBLK_F_AUTO_BUF_REG: - register request buffer automatically before delivering io command to ublk server - unregister request buffer automatically when completing the request - both io_uring context and buffer index can be specified from ublk uring_cmd header With this way, 'fio/t/io_uring -p0 /dev/ublkb0' shows that IOPS is improved by 50% compared with F_SUPPORT_ZERO_COPY in my test VM. kernel selftests are added for covering both function & stress test. Please review & comment! Thanks, Ming Ming Lei (7): io_uring: add 'struct io_buf_data' for register/unregister bvec buffer io_uring: add helper __io_buffer_[un]register_bvec io_uring: support to register bvec buffer to specified io_uring ublk: convert to refcount_t ublk: prepare for supporting to register request buffer automatically ublk: register buffer to specified io_uring & buf index via UBLK_F_AUTO_BUF_REG selftests: ublk: support UBLK_F_AUTO_BUF_REG drivers/block/ublk_drv.c | 165 ++++++++++++++---- include/linux/io_uring/cmd.h | 15 +- include/uapi/linux/ublk_cmd.h | 38 ++++ io_uring/rsrc.c | 141 ++++++++++----- tools/testing/selftests/ublk/Makefile | 2 + tools/testing/selftests/ublk/file_backed.c | 12 +- tools/testing/selftests/ublk/kublk.c | 24 ++- tools/testing/selftests/ublk/kublk.h | 6 + tools/testing/selftests/ublk/null.c | 43 +++-- tools/testing/selftests/ublk/stripe.c | 21 +-- .../testing/selftests/ublk/test_generic_08.sh | 32 ++++ .../testing/selftests/ublk/test_stress_03.sh | 6 + .../testing/selftests/ublk/test_stress_04.sh | 6 + .../testing/selftests/ublk/test_stress_05.sh | 8 + 14 files changed, 409 insertions(+), 110 deletions(-) create mode 100755 tools/testing/selftests/ublk/test_generic_08.sh -- 2.47.0