public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] ublk: add shared memory zero-copy support
@ 2026-03-28 13:48 Ming Lei
  2026-03-28 13:48 ` [PATCH 1/8] ublk: add UBLK_U_CMD_REG_BUF/UNREG_BUF control commands Ming Lei
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Ming Lei @ 2026-03-28 13:48 UTC (permalink / raw)
  To: Jens Axboe, linux-block; +Cc: Caleb Sander Mateos, Ming Lei

Hello,

Add shared memory based zero-copy (UBLK_F_SHMEM_ZC) support for ublk.

The ublk server and its client share a memory region (e.g. memfd or
hugetlbfs file) via MAP_SHARED mmap. The server registers this region
with the kernel via UBLK_U_CMD_REG_BUF, which pins the pages and
builds a PFN maple tree. When I/O arrives, the driver looks up bio
pages in the maple tree — if they match registered buffer pages, the
data is used directly without copying.

Please see details on document added in patch 3.

Patches 1-3 implement the kernel side:
 - buffer register/unregister control commands with PFN coalescing
 - PFN-based matching in the I/O path
 - UBLK_F_SHMEM_ZC feature flag

Patches 4-8 add kublk (selftest server) support and tests:
 - hugetlbfs buffer sharing (both kublk and fio mmap the same file)
 - null target and loop target tests with fio verify
 - filesystem-level test (ext4 on ublk, fio verify on a file)

Ming Lei (8):
  ublk: add UBLK_U_CMD_REG_BUF/UNREG_BUF control commands
  ublk: add PFN-based buffer matching in I/O path
  ublk: enable UBLK_F_SHMEM_ZC feature flag
  selftests/ublk: add shared memory zero-copy support in kublk
  selftests/ublk: add UBLK_F_SHMEM_ZC support for loop target
  selftests/ublk: add shared memory zero-copy test
  selftests/ublk: add hugetlbfs shmem_zc test for loop target
  selftests/ublk: add filesystem fio verify test for shmem_zc

 Documentation/block/ublk.rst                  | 117 ++++++
 drivers/block/ublk_drv.c                      | 365 +++++++++++++++++-
 include/uapi/linux/ublk_cmd.h                 |  75 ++++
 tools/testing/selftests/ublk/Makefile         |   4 +
 tools/testing/selftests/ublk/file_backed.c    |  38 ++
 tools/testing/selftests/ublk/kublk.c          | 339 +++++++++++++++-
 tools/testing/selftests/ublk/kublk.h          |  14 +
 tools/testing/selftests/ublk/test_common.sh   |  15 +-
 .../testing/selftests/ublk/test_shmemzc_01.sh |  72 ++++
 .../testing/selftests/ublk/test_shmemzc_02.sh |  68 ++++
 .../testing/selftests/ublk/test_shmemzc_03.sh |  69 ++++
 11 files changed, 1168 insertions(+), 8 deletions(-)
 create mode 100755 tools/testing/selftests/ublk/test_shmemzc_01.sh
 create mode 100755 tools/testing/selftests/ublk/test_shmemzc_02.sh
 create mode 100755 tools/testing/selftests/ublk/test_shmemzc_03.sh

-- 
2.53.0


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

end of thread, other threads:[~2026-03-28 13:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-28 13:48 [PATCH 0/8] ublk: add shared memory zero-copy support Ming Lei
2026-03-28 13:48 ` [PATCH 1/8] ublk: add UBLK_U_CMD_REG_BUF/UNREG_BUF control commands Ming Lei
2026-03-28 13:48 ` [PATCH 2/8] ublk: add PFN-based buffer matching in I/O path Ming Lei
2026-03-28 13:48 ` [PATCH 3/8] ublk: enable UBLK_F_SHMEM_ZC feature flag Ming Lei
2026-03-28 13:48 ` [PATCH 4/8] selftests/ublk: add shared memory zero-copy support in kublk Ming Lei
2026-03-28 13:49 ` [PATCH 5/8] selftests/ublk: add UBLK_F_SHMEM_ZC support for loop target Ming Lei
2026-03-28 13:49 ` [PATCH 6/8] selftests/ublk: add shared memory zero-copy test Ming Lei
2026-03-28 13:49 ` [PATCH 7/8] selftests/ublk: add hugetlbfs shmem_zc test for loop target Ming Lei
2026-03-28 13:49 ` [PATCH 8/8] selftests/ublk: add filesystem fio verify test for shmem_zc Ming Lei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox