]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/ublk: add shared memory zero-copy test
authorMing Lei <ming.lei@redhat.com>
Tue, 31 Mar 2026 15:31:58 +0000 (23:31 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 7 Apr 2026 13:42:23 +0000 (07:42 -0600)
commit2f1e9468bdcba7e7572e16defd3c516f24281f14
treef78c23955a35c32e4d46da19529d19b6a235472f
parentec20aa44ac2629943c9b2b5524bcb55d778f746c
selftests/ublk: add shared memory zero-copy test

Add test_shmem_zc_01.sh which tests UBLK_IO_F_SHMEM_ZC on the null
target using a hugetlbfs shared buffer. Both kublk (--htlb) and fio
(--mem=mmaphuge:<path>) mmap the same hugetlbfs file with MAP_SHARED,
sharing physical pages. The kernel PFN match enables zero-copy I/O.

Uses standard fio --mem=mmaphuge:<path> (supported since fio 1.10),
no patched fio required.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://patch.msgid.link/20260331153207.3635125-8-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
tools/testing/selftests/ublk/Makefile
tools/testing/selftests/ublk/test_shmemzc_01.sh [new file with mode: 0755]