]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/ublk: add hugetlbfs shmem_zc test for loop target
authorMing Lei <ming.lei@redhat.com>
Tue, 31 Mar 2026 15:31:59 +0000 (23:31 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 7 Apr 2026 13:42:23 +0000 (07:42 -0600)
commitd4866503324c062f70dddfdd2e59957d335fc230
treece3e855735b0c0d4c71c8216017b573d86848423
parent2f1e9468bdcba7e7572e16defd3c516f24281f14
selftests/ublk: add hugetlbfs shmem_zc test for loop target

Add test_shmem_zc_02.sh which tests the UBLK_IO_F_SHMEM_ZC zero-copy
path on the loop target using a hugetlbfs shared buffer. Both kublk and
fio mmap the same hugetlbfs file with MAP_SHARED, sharing physical
pages. The kernel's PFN matching enables zero-copy — the loop target
reads/writes directly from the shared buffer to the backing file.

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-9-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
tools/testing/selftests/ublk/Makefile
tools/testing/selftests/ublk/test_shmemzc_02.sh [new file with mode: 0755]